Last active
March 29, 2016 17:47
-
-
Save TSchuermans/eecf5c4c23aa96689445bb9f6103d75c to your computer and use it in GitHub Desktop.
commit-msg
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
#!/usr/bin/env bash | |
# .git/hooks/commit-msg | |
pattern="(JIRA|PROJECTKEY)\-[0-9]" | |
check=$(grep -E "${pattern}" "${1}") | |
if [[ "${check}" != "" ]]; then | |
exit 0 | |
else | |
echo "Invalid commit message, commit message should contain project key and issue key separated by a dash. e.g. JIRA-123" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment