Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ BRANCH_MERGE_BASE=$(git merge-base ${BASE_BRANCH} ${CURRENT_BRANCH})
# Find all commits since common ancestor
BRANCH_COMMITS=$(git rev-list ${BRANCH_MERGE_BASE}..HEAD)

#echo $BRANCH_COMMITS

# Check every commit message since ancestor for regex match
for commit in $BRANCH_COMMITS; do
COMMIT_MSG_UPPER=$(git log --max-count=1 --format=%B $commit | tr '[a-z]' '[A-Z]')
Expand Down Expand Up @@ -50,7 +48,7 @@ done
# If any commit are invalid, print the reject message
if [ "$invalidCommit" == true ]; then
echo "Commit messages must include a JIRA ticket number e.g. \"AAA-1234\". This can be anywhere in your commit"
echo "You can skip this step if necessary by running \"git commit --amend\" and add \"[skip jira]\" in your commit message"
echo "You can skip this whole step if necessary by running \"git commit --amend\" and add \"[skip jira]\" in your commit message"
echo "Please fix the commit message(s) and push again."
echo "https://help.github.com/en/articles/changing-a-commit-message"
echo "************"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Commit Checker
name: Commit messages contain a Jira issue

# Run on push to any branch
on: [pull_request]

jobs:
commit-checker:
commit-linting:
runs-on: ubuntu-latest

steps:
Expand All @@ -13,6 +13,5 @@ jobs:
fetch-depth: 0
ref: '${{ github.event.pull_request.base.ref }}'

- name: Commit validation
run: bash ${GITHUB_WORKSPACE}/.github/scripts/commit-checker.sh ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }}

- name: Commit messages contain a Jira issue
run: bash ${GITHUB_WORKSPACE}/.github/scripts/commit-checker.sh ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# gh-actions-playground

test 2345
test 234567s