Created
April 9, 2020 08:54
-
-
Save lucianmachado/459e3cbd39658406ecf530f35b00884f to your computer and use it in GitHub Desktop.
conventional commit hook bash
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 | |
COMMIT_MESSAGE=$(cat $1) | |
OUTPUT=$(echo $COMMIT_MESSAGE | awk '/^(build|ci|chore|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(\!|\\\!)?: .*/'); | |
if [[ ${#OUTPUT} -gt 0 ]]; then | |
exit 0; | |
else | |
echo "Mensagem de commit inválida. \n Consulte https://www.conventionalcommits.org/pt-br."; | |
exit 1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment