Skip to content

Commit 1c745d1

Browse files
committed
another bad commit
1 parent 4730576 commit 1c745d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/scripts/commit-checker.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
3738
done
3839
# If any commit are invalid, print reject message
3940
if [ "$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 "************"

.github/workflows/commit-checker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: [pull_request]
55

66
jobs:
77
commit-checker:
8+
if: "!contains(github.event.commits[0].message, '[skip jira]')"
89
runs-on: ubuntu-latest
910

1011
steps:

0 commit comments

Comments
 (0)