Skip to content

Commit 21462af

Browse files
Copilotcziter15Copilot
authored
ci: fix PR title validation to enforce strict conventional commits format (#90)
* Initial plan * ci: fix PR title validation to enforce strict conventional commits format Co-authored-by: cziter15 <[email protected]> * Change pull_request to pull_request_target * Update .github/workflows/validate-commits.yml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: cziter15 <[email protected]> Co-authored-by: Krzysztof Strehlau <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 92aa2ac commit 21462af

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)