From 99776480e80dbd9cda15a7d1e340c0dc9fd4a7d2 Mon Sep 17 00:00:00 2001
From: Twirre Meulenbelt <43213592+TwirreM@users.noreply.github.com>
Date: Wed, 8 Oct 2025 16:25:51 +0200
Subject: [PATCH] chore: correct commit hook regex
Previously all branch names had to have two dashes. Now it can have one to six words.
ref: N25B-89
---
.githooks/pre-commit | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index 391d279..ed801d8 100644
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -8,11 +8,11 @@ if echo "$branch" | grep -Eq "(dev|main)"; then
fi
# allowed pattern
-if echo "$branch" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert)\/\w+-\w+-\w+"; then
+if echo "$branch" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert)\/\w+(-\w+){0,5}$"; then
echo "✅ Branch name valid: $branch"
exit 0
else
echo "❌ Invalid branch name: $branch"
- echo "Branch must be named / (must have 2 stipes - -)"
+ echo "Branch must be named / (must have one to six words separated by a dash)"
exit 1
fi
\ No newline at end of file