Last active
January 27, 2023 18:12
-
-
Save mxchinegod/d99a7494c8b84c2e99fce28468334aa5 to your computer and use it in GitHub Desktop.
commit-msg git hook to force Angular conventions!
This file contains hidden or 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 | |
REGEX="(feat|fix|docs|ui|chore|locale)\((refactor|perf|workflow|build|CI|typos|tests|types|wip|release|dep)\):\s.+" | |
if ! grep -iqE "$REGEX" "$1"; then | |
echo "Invalid commit message format. Use the following format: [emoji] [revert: ?]<type>[(scope)?]: <message>" | |
echo "e.g. '🎨 feat(workflow): Added commit-msg hook'" | |
exit 1 | |
else | |
pre-commit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment