File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ BRANCH_MERGE_BASE=$(git merge-base ${BASE_BRANCH} ${CURRENT_BRANCH})
2020# Find all commits since common ancestor
2121BRANCH_COMMITS=$( git rev-list ${BRANCH_MERGE_BASE} ..HEAD)
2222
23- # echo $BRANCH_COMMITS
24-
2523# Check every commit message since ancestor for regex match
2624for commit in $BRANCH_COMMITS ; do
2725 COMMIT_MSG_UPPER=$( git log --max-count=1 --format=%B $commit | tr ' [a-z]' ' [A-Z]' )
5048# If any commit are invalid, print the reject message
5149if [ " $invalidCommit " == true ]; then
5250 echo " Commit messages must include a JIRA ticket number e.g. \" AAA-1234\" . This can be anywhere in your commit"
53- echo " You can skip this step if necessary by running \" git commit --amend\" and add \" [skip jira]\" in your commit message"
51+ echo " You can skip this whole step if necessary by running \" git commit --amend\" and add \" [skip jira]\" in your commit message"
5452 echo " Please fix the commit message(s) and push again."
5553 echo " https://help.github.com/en/articles/changing-a-commit-message"
5654 echo " ************"
Original file line number Diff line number Diff line change 1- name : Commit Checker
1+ name : Commit messages contain a Jira issue
22
33# Run on push to any branch
44on : [pull_request]
55
66jobs :
7- commit-checker :
7+ commit-linting :
88 runs-on : ubuntu-latest
99
1010 steps :
1313 fetch-depth : 0
1414 ref : ' ${{ github.event.pull_request.base.ref }}'
1515
16- - name : Commit validation
17- run : bash ${GITHUB_WORKSPACE}/.github/scripts/commit-checker.sh ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }}
18-
16+ - name : Commit messages contain a Jira issue
17+ run : bash ${GITHUB_WORKSPACE}/.github/scripts/commit-checker.sh ${{ github.event.pull_request.head.ref }} ${{ github.event.pull_request.base.ref }}
Original file line number Diff line number Diff line change 11# gh-actions-playground
22
3- test 2345
3+ test 234567s
You can’t perform that action at this time.
0 commit comments