Skip to content

Commit

Permalink
🔧 chore: add husky commit-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie-Wong-H committed Oct 13, 2021
1 parent 43c374f commit c4ff26a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# Validate commit log

commit_regex="^Merge.+|(:tada: feat|:bug: fix|:pencil: docs|:art: style|:hammer: refactor|:racehorse: perf|:cop: test|:construction: build|:rocket: ci|:wrench: chore|:arrow_backward: revert)(\(.+\))?: .{1,50}"

msg=`cat $HUSKY_GIT_PARAMS`

if [[ "$msg" =~ $commit_regex ]]; then
exit 0
else
echo " Please use a valid commit message. "
echo " See commit_regex in commit_msg for more details. "
exit 1
fi

0 comments on commit c4ff26a

Please sign in to comment.