Skip to content

Instantly share code, notes, and snippets.

@ConorSheehan1
Last active April 25, 2018 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ConorSheehan1/5a6b3d7c4fbc0828d451db1c962cafd8 to your computer and use it in GitHub Desktop.
Save ConorSheehan1/5a6b3d7c4fbc0828d451db1c962cafd8 to your computer and use it in GitHub Desktop.
check commit message contains link to trello card
#!/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