ci: enforce Conventional Commits format on PR titles#164
Merged
Conversation
The repo squash-merges PRs, so the PR title becomes the commit message on master that semantic-release reads to compute version bumps. Add a status check that rejects PRs whose title doesn't match Conventional Commits (feat/fix/perf/chore/docs/style/refactor/test/build/ci/revert, scope optional). To actually block merges, the "Validate Conventional Commits title" check must be added to master's branch protection as a required status check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cernadasjuan
approved these changes
May 26, 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.
Summary
Adds a new workflow that validates PR titles against the Conventional Commits spec. The repo squash-merges PRs, so each PR title becomes the commit on
masterthat semantic-release parses to decide the next version bump — without this gate, a non-conforming title produces a commit semantic-release ignores (no release at all) or misclassifies.How it works
.github/workflows/pr-title.ymlamannn/action-semantic-pull-request@v6.1.1— the de-facto standard for this.pull_request(opened,edited,reopened,synchronize) targetingmaster. Re-runs whenever the title is edited so contributors can fix it in place.pull-requests: readonly.Config
Allowed types (matches semantic-release's Angular preset plus common no-release types):
feat,fix,perfchore,docs,style,refactor,test,build,ci,revertScope is optional (
fix:andfix(test):both pass).Required follow-up (outside this PR)
The action only reports a status check called
Validate Conventional Commits title. To actually block merges of non-conforming PRs, that check needs to be added tomaster's branch protection rule as a required status check. After this PR merges, open one test PR with a bad title to make the check appear in the list, then add it.Test plan
bad title— the check should fail.chore: test pr title check— the check should re-run and pass.Validate Conventional Commits titletomasterbranch protection's required checks.🤖 Generated with Claude Code