Last active
December 6, 2017 14:48
-
-
Save mmh/6347dca48ae8cea6cec19d66307a4c1a to your computer and use it in GitHub Desktop.
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 | |
# regex to validate in commit message | |
commit_regex='#[A-Z]{2,}-[0-9]+' | |
error_msg="Aborting commit. Your commit message is missing a JIRA Issue ('XXX-YY')" | |
if ! grep -qE "$commit_regex" "$1"; then | |
echo "$error_msg" >&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment