File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ for commit in $BRANCH_COMMITS; do
2828 else
2929 # If commit doesn't match regex, commit isn't valid, print commit info
3030 echo " ************"
31- printf " Invalid commit message: \" %s\" and hash: %s\n" " $( git log --max-count=1 --format=%B $commit ) " " $commit "
31+ printf " Invalid commit message: \" %s\" \n" " $( git log --max-count=1 --format=%B $commit ) "
32+ printf " commit sha: %s\n" " $commit "
3233 echo " ************"
3334
3435 # Set this variable to trigger rejection if any commit fails regex
@@ -37,7 +38,8 @@ for commit in $BRANCH_COMMITS; do
3738done
3839# If any commit are invalid, print reject message
3940if [ " $invalidCommit " == true ]; then
40- echo " Your push was rejected because at least one commit message on this branch is invalid"
41+ echo " Commits must include a JIRA ticket number e.g. AAA-1234"
42+ echo " You can skip this step if necessary by running \" git --amend\" and add \" [skip jira]\" in your commit message"
4143 echo " Please fix the commit message(s) and push again."
4244 echo " https://help.github.com/en/articles/changing-a-commit-message"
4345 echo " ************"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ on: [pull_request]
55
66jobs :
77 commit-checker :
8+ if : " !contains(github.event.commits[0].message, '[skip jira]')"
89 runs-on : ubuntu-latest
910
1011 steps :
Original file line number Diff line number Diff line change 11# gh-actions-playground
22
3- test
3+ test 2
You can’t perform that action at this time.
0 commit comments