Skip to content

Instantly share code, notes, and snippets.

@qapquiz
Last active March 27, 2019 11:14
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 qapquiz/76786091286b3e759103944c6ab4fc23 to your computer and use it in GitHub Desktop.
Save qapquiz/76786091286b3e759103944c6ab4fc23 to your computer and use it in GitHub Desktop.
commit-msg git hook that will use commitlint to enforce commit message to use conventional commit style
#!/bin/sh
temp_file_that_contain_commit_message=$1
commit_message=$(cat "$temp_file_that_contain_commit_message")
echo "$commit_message" | commitlint
commitlint_status=$?
if [ $commitlint_status -ne 0 ] ; then
echo "commit message should be in angular format"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment