Created
August 23, 2019 13:18
-
-
Save guangtuan/becfee630137a5441d0297f12d5d916c to your computer and use it in GitHub Desktop.
pre-check git commit message
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 | |
MSG=$(cat $1) | |
if ! [[ "$MSG" =~ ^#[0-9]{4} ]];then | |
echo "Your commit message must starts with a story number, like "#1234"" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment