Skip to content

ci: enforce Conventional Commits format on PR titles#164

Merged
Gabrielpanga merged 1 commit into
masterfrom
ci/validate-pr-title
May 26, 2026
Merged

ci: enforce Conventional Commits format on PR titles#164
Gabrielpanga merged 1 commit into
masterfrom
ci/validate-pr-title

Conversation

@Gabrielpanga
Copy link
Copy Markdown
Member

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 master that 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

  • New workflow: .github/workflows/pr-title.yml
  • Uses amannn/action-semantic-pull-request@v6.1.1 — the de-facto standard for this.
  • Triggers on pull_request (opened, edited, reopened, synchronize) targeting master. Re-runs whenever the title is edited so contributors can fix it in place.
  • Permissions: pull-requests: read only.

Config

Allowed types (matches semantic-release's Angular preset plus common no-release types):

  • Releases a version: feat, fix, perf
  • No release (still allowed): chore, docs, style, refactor, test, build, ci, revert

Scope is optional (fix: and fix(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 to master'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

  • Merge this PR.
  • Open a test PR with title bad title — the check should fail.
  • Edit the title to chore: test pr title check — the check should re-run and pass.
  • Add Validate Conventional Commits title to master branch protection's required checks.
  • Close the test PR.

🤖 Generated with Claude Code

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>
@Gabrielpanga Gabrielpanga merged commit f488363 into master May 26, 2026
1 of 2 checks passed
@Gabrielpanga Gabrielpanga deleted the ci/validate-pr-title branch May 26, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants