ci: enforce conventional commit PR titles#16
Merged
Merged
Conversation
Review Summary by QodoEnforce Conventional Commit PR titles via GitHub workflow
WalkthroughsDescription• Add GitHub workflow to enforce Conventional Commit PR titles • Validate PR titles against allowed types (feat, fix, docs, chore, ci, refactor, perf, test, build, revert) • Require lowercase subject start to match release-please expectations • Document PR title requirements and squash-merge strategy in CLAUDE.md Diagramflowchart LR
PR["Pull Request"] -- "title validation" --> Workflow["pr-title Workflow"]
Workflow -- "checks against types" --> Semantic["Semantic PR Action"]
Semantic -- "validates format" --> Result["Pass/Fail Status"]
Result -- "feeds into" --> ReleasePlease["release-please"]
ReleasePlease -- "derives version bump" --> Release["Release"]
File Changes1. .github/workflows/pr-title.yml
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
151 rules 1. Subject regex too permissive
|
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.
Why
The repo is now squash-merge only, with the squash commit subject taken from the PR title (
squash_merge_commit_title=PR_TITLE).release-pleasederives the version bump + changelog from that subject — so a non-conventional PR title would silently break versioning (e.g. produce no release, or the wrong bump).This adds a
pr-titlecheck that validates every PR title against Conventional Commits, usingamannn/action-semantic-pull-request@v6.1.1.Details
pull_request_target(so it also runs on fork PRs); it only reads the title via the API — no PR code is checked out, so there's no untrusted-code risk.permissions: pull-requests: read.feat, fix, docs, chore, ci, refactor, perf, test, build, revert.CLAUDE.md.Follow-up (your call)
Add
conventional PR titletomain's required status checks so it's a hard gate. release-please's own PRs (chore(main): release X.Y.Z) pass it, so it's safe to require.