Created
March 23, 2017 13:10
-
-
Save wickdninja/4d20d88a1b22ceb6f59982d1e5d07197 to your computer and use it in GitHub Desktop.
Require Jira Ticket in commit message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Require Jira Ticket in commit message | |
KEY="ABP-" | |
WARNING="Jira ticket reference NOT FOUND but is required!" | |
MESSAGE=$(<$1) | |
case "$MESSAGE" in | |
$KEY*) | |
exit 0; | |
;; | |
*$KEY*) | |
WARNING="Jira reference MUST be the 1st token in your message!" | |
;; | |
esac | |
echo $WARNING | |
echo "Example" | |
echo "git commit -m 'ABC-1234 #resolve #time 3h 20m'" | |
exit -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment