Last active
April 25, 2018 11:06
-
-
Save ConorSheehan1/5a6b3d7c4fbc0828d451db1c962cafd8 to your computer and use it in GitHub Desktop.
check commit message contains link to trello card
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 | |
# this hook aborts commits which do not include a link to trello | |
INPUT_FILE=$1 | |
START_LINE=`head -n1 $INPUT_FILE` | |
PATTERN="https:\/\/trello\.com\/" | |
if ! [[ "$START_LINE" =~ $PATTERN ]]; then | |
echo "Commit messages should include a link to the related trello card." | |
echo "To override this check add the --no-verify flag " | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment