ci: validate PR title against Conventional Commits#635
Merged
Conversation
GitHub uses the pull request title (not the first commit subject) for "Squash and merge" commits, but the existing commitlint job only validates individual commit messages. A mis-formatted PR title therefore produces an invalid commit on main even when every commit on the branch is fine. Add a workflow that runs amannn/action-semantic-pull-request against the PR title on every open/edit/synchronize/reopen, using the same type set as @commitlint/config-conventional and enforcing lowercase-subject to mirror commitlint's subject-case rule. Fixes #531
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #635 +/- ##
==========================================
- Coverage 86.12% 86.06% -0.06%
==========================================
Files 29 29
Lines 3488 3488
Branches 602 602
==========================================
- Hits 3004 3002 -2
- Misses 299 300 +1
- Partials 185 186 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated GitHub Actions workflow to lint pull request titles against the Conventional Commits format, ensuring squash-merge commit subjects remain valid even when individual commits already pass commitlint.
Changes:
- Introduces
.github/workflows/pr-title.ymlto validate PR titles usingamannn/action-semantic-pull-request(pinned to a commit SHA). - Runs on
pull_request_targetwith restricted permissions (pull-requests: read) to safely validate titles for forked PRs. - Enforces a lowercase-first-character subject convention via
subjectPattern.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bdraco
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Add a GitHub Actions workflow that validates the pull request title against the Conventional Commits spec.
Why
GitHub uses the PR title — not the first commit's subject — as the commit message when "Squash and merge" is used. The existing
commitlintjob inci.ymlonly lints individual commit messages, so a malformed PR title still produces an invalid commit onmaineven when every commit on the branch passes. Fixes #531.How
.github/workflows/pr-title.ymlrunsamannn/action-semantic-pull-request@v6.1.1(pinned to SHA, matching the rest of the repo).pull_request_targetso external/fork PRs can be validated safely (only PR metadata is read;permissions: pull-requests: read).@commitlint/config-conventional(build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test).subjectPattern: ^(?![A-Z]).+$enforces lowercase first letter to match commitlint'ssubject-caserule.Testing
python3 -c \"import yaml; yaml.safe_load(...)\"confirms the workflow file parses.Quality Report
Changes: 1 file changed, 52 insertions(+)
Code scan: clean
Tests: failed ([Errno 13] Permission denied: 'pytest')
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline