Skip to content

Commit 4e52696

Browse files
Copilotcziter15
andcommitted
ci: fix PR title validation to enforce strict conventional commits format
Co-authored-by: cziter15 <[email protected]>
1 parent 4fa4ed3 commit 4e52696

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/validate-commits.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
# Conventional commits regex pattern
2222
# Matches: type[(scope)][!]: description
2323
# Where type is one of: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
24-
PATTERN='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .{1,}'
24+
# Scope (optional) can contain: lowercase letters, numbers, hyphens, underscores, forward slashes
25+
# Description must start with a lowercase letter
26+
PATTERN='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9/_-]+\))?!?: [a-z].+'
2527
2628
if [[ ! "$PR_TITLE" =~ $PATTERN ]]; then
2729
echo "================================================"

0 commit comments

Comments
 (0)