diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0d48662e1b..099826457d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -16,7 +16,7 @@ Release Notes: - [ ] After integration of the pull request, I verified our [bluemix test environment](http://taskana.mybluemix.net/taskana) is not broken ### Verified by the reviewer: -- [ ] Commit message format → TSK-XXX: Your commit message. +- [ ] Commit message format → (Closes) #: Your commit message. i.e. Closes #2271: Your commit message. - [ ] Submitter's update to [documentation](https://taskana.atlassian.net/wiki/spaces/TAS/overview) is sufficient - [ ] SonarCloud analysis meets our standards - [ ] Update of the [current release notes](https://taskana.atlassian.net/wiki/spaces/TAS/pages/1281392672/Current+Release+Notes+Taskana) reflects changes diff --git a/qa/hooks/commit-msg b/qa/hooks/commit-msg index 0b16507a6e..c9c82fba33 100755 --- a/qa/hooks/commit-msg +++ b/qa/hooks/commit-msg @@ -1,15 +1,15 @@ #!/bin/bash MSG_FILE=$1 COMMIT_MESSAGE="$(cat $MSG_FILE)" -REGEX='^(TSK-[0-9]+):' +REGEX='^(Close|Closes|Closed|Fix|Fixes|Fixed|Resolve|Resolves|Resolved) #([0-9]+)' if [[ $COMMIT_MESSAGE =~ $REGEX ]]; then - TICKET=${BASH_REMATCH[1]} - RESULT=$(curl -s https://taskana.atlassian.net/rest/api/3/issue/$TICKET) - if [[ $RESULT =~ "errorMessages" ]]; then - echo -e "\033[0;31mERROR:\033[0m $TICKET is not a valid ticket number" + TICKET=${BASH_REMATCH[2]} + RESULT=$(curl -s https://api.github.com/repos/Taskana/taskana/issues/$TICKET) + if [[ $RESULT =~ "\"message\": \"Not Found\"" ]]; then + echo -e "\033[0;31mERROR:\033[0m $TICKET is not a valid GitHub issue" exit 1 fi else - echo -e "\033[0;31mERROR:\033[0m Prefix Git commit messages with the ticket number, e.g. TSK-140: xyz..." + echo -e "\033[0;31mERROR:\033[0m Prefix Git commit messages with the GitHub issue, e.g. Closes #2271: xyz..." exit 1 fi