ci: fix PR title validation to enforce strict conventional commits format #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The PR title validation workflow was not strict enough in enforcing the Conventional Commits specification. It incorrectly accepted malformed PR titles that violate the guidelines documented in CONTRIBUTING.md.
Issues Fixed
1. Malformed Scopes
The original pattern used
(\(.+\))?for scope validation, where.+matches ANY character including closing parentheses. This allowed invalid scopes:2. Capitalized Descriptions
The original pattern used
: .{1,}for description validation, which allowed any character to start the description. This violated the CONTRIBUTING.md guideline to "use lowercase for type and description":Solution
Updated the regex pattern in
.github/workflows/validate-commits.yml:Changes:
(\([a-z0-9/_-]+\))?now only accepts lowercase letters, numbers, hyphens, underscores, and forward slashes[a-z].+now requires the description to start with a lowercase letterImpact
✅ All valid PR titles remain accepted (backward compatible)
✅ Malformed scopes are now properly rejected
✅ Capitalized descriptions are now properly rejected
✅ Strict enforcement of Conventional Commits spec
✅ Aligns with CONTRIBUTING.md guidelines
Examples
Valid PR titles (still accepted):
Invalid PR titles (now properly rejected):
This ensures PR titles strictly follow the Conventional Commits specification, which is important for automated changelog generation and project maintainability.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.