Last active
August 29, 2015 14:16
-
-
Save Aricg/9c816b784edfdb65b35f to your computer and use it in GitHub Desktop.
ref-update enforcement hook for jira issue
This file contains hidden or 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/bash | |
ref="$(awk -F'newrev' '{print $2}' <<< "$@" | xargs)" | |
log="$(git log --format=%s%b -n 1 "$ref")" | |
if grep -iq "JIRA:*[0-9]*" <<< "$log" | |
then | |
: | |
else | |
echo "Commit rejected, please provide a jira issue in the format JIRA: ISSUE_NUMBER in the commit message" | |
exit 1 | |
fi | |
if grep -iq "SecurityImpact" <<< "$log" | |
then | |
echo "$log" | /bin/mail -s "Security Impact Detected" [email protected] | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment