Skip to content

Commit

Permalink
chore: Tighten up the check in the commit message hook (20240925)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenMcConnel committed Sep 25, 2024
1 parent ea91be6 commit d0e8afc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
# Read the commit message from the file passed as an argument
COMMIT_MSG=$(cat "$1")

# Check if the commit message contains a colon.
# This is a super basic validation and could certainly be improved.
if ! echo "$COMMIT_MSG" | grep -q ":"; then
# Check if the commit message starts with an expected keyword followed by a colon.
if ! echo "$COMMIT_MSG" | grep -q "^\(fix\|feat\|chore\):"; then
echo "Improper commit message for semantic-release."
echo "Please use the format 'type: message'"
echo "e.g. chore: Updated README"
Expand Down

0 comments on commit d0e8afc

Please sign in to comment.