Added githooks

This commit is contained in:
2584433
2025-10-07 14:55:04 +00:00
parent 318ad5f88a
commit eb091968a6
4 changed files with 58 additions and 0 deletions

17
.githooks/commit-msg Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
commit_msg_file=$1
commit_msg=$(cat "$commit_msg_file")
if echo "$commit_msg" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert): .+"; then
if echo "$commit_msg" | grep -Eq "^(ref|close):\sN25B-.+"; then
echo "🎉 commit message is Valid"
exit 0
else
echo "❌ Commit message invalid! Must end with [ref/close]: N25B-000"
exit 1
fi
else
echo "❌ Commit message invalid! Must start with <type>: <description>"
exit 1
fi