Skip to content

Commit

Permalink
feat/checkcommitmsg improve pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
hminaee-tc committed Jul 30, 2024
1 parent dfea6d4 commit e2e4f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hooks/check-commit-msg.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
# set -e
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# Source fork-utils.sh using the calculated directory
source "${SCRIPT_DIR}/utils/fork_utils.sh"
Expand All @@ -10,7 +9,9 @@ fi

# Path to the commit-msg hook
HOOK_PATH=".git/hooks/commit-msg"

rm -rf $HOOK_PATH || true

# Desired content of the commit-msg hook
read -r -d '' HOOK_CONTENT <<'EOF'
#!/bin/bash
Expand Down Expand Up @@ -43,7 +44,7 @@ check_branch_name
COMMIT_MSG_FILE=$1
# Regular expression for the required commit message format
PATTERN="^(feat|fix|build|breaking|chore|ci|docs|perf|refactor|revert|test)\/[a-zA-Z0-9-]+)?(:)? *.+$"
PATTERN="^(feat|fix|build|breaking|chore|ci|docs|perf|refactor|revert|test)\/[a-zA-Z0-9-]+)(:)? *.+$"
# Read the commit message
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
Expand Down

0 comments on commit e2e4f0e

Please sign in to comment.