Created
September 22, 2020 15:43
-
-
Save yeisoncruz16/f70232757e513cf6177765a739bbfd45 to your computer and use it in GitHub Desktop.
simple commit message hook to validate message contain :
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/bash | |
MSG="$1" | |
message="Hey! looks like your commit message is not following correct format" | |
if ! grep -qE ":" "$MSG"; | |
then | |
printf "\n"; | |
echo -e "\e[91m${message}\e[0m"; | |
echo "Your commit message: " && cat "${MSG}"; | |
printf "\n"; | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment