Skip to content

Commit

Permalink
chore: update .githooks/commit-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Mar 22, 2024
1 parent a44a975 commit dc4101a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
# Create a regex for a conventional commit.
convetional_commit_regex="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z \-]+\))?!?: .+$"

# Accept Merge commits
merge_msg_regex="^Merge branch '.+'.+$"

# Get the commit message (the parameter we're given is just the path to the
# temporary file which holds the message).
commit_message=$(cat "$1")

if [[ "$commit_message" =~ $merge_msg_regex ]]; then
echo -e "\e[32mAccept Merge commits...\e[0m"
exit 0
fi

# Check the message, if we match, all good baby.
if [[ "$commit_message" =~ $convetional_commit_regex ]]; then
echo -e "\e[32mCommit message meets Conventional Commit standards...\e[0m"
Expand Down

0 comments on commit dc4101a

Please sign in to comment.