Repository navigation
ci: check that PR titles are conventional commit subjects - #1464
Merged
Merged
Conversation
This was referenced Nov 25, 2026
robinnsc
force-pushed
the
ci/pr-title-check
branch
from
November 29, 2026 01:33
9d46b1d to
76701aa
Compare
robinnsc
marked this pull request as ready for review
November 30, 2026 21:56
robinnsc
requested review from
LeeroyHannigan,
amrith,
c33howard,
demohan,
eliseong,
hitesh96db,
jcshepherd,
navareamol and
pdf-amzn
as code owners
November 30, 2026 21:56
This adds a PR title check, the `conventional` job of the PR title workflow, which fails when a PR title is not a conventional commit subject. It changes nothing else. It relies on merge settings that the admin applies when this merges (last paragraph). The release automation tracked in #1395 will build the changelog from the commit subjects on main. Most subjects on main have the conventional shape, but nothing checks it; for example #596's (b0d1c64) does not. In the 0.1.15 cycle two squash-merged PR titles did not have it, and seven merge commits brought 24 more subjects to main that do not have it. devtools/check-pr-title accepts `type(scope)!: summary`, with the scope and the `!` optional. The type is one of the eleven of commitlint's config-conventional: build, chore, ci, docs, feat, fix, perf, refactor, revert, style and test. A scope is lowercase letters, digits, `.`, `_`, `/` and `-`. A refusal names the rule that failed: the shape, the type, the scope or the space after the colon. The PR title workflow runs it on opened, edited, reopened and synchronize events. The title reaches the script through the environment. The job checks out devtools/ (in cone mode, also the files at the repository root) from the default branch, so a PR that edits the checker is checked by main's version, and an older or stacked PR whose base has no checker still gets main's. The workflow file itself runs from the PR's merge ref, as every pull_request workflow does, so a change to it is protected by review only. Until main has a checker, on this PR and the PRs stacked on it, the job uses the PR's own copy. A merge queue run has no title, so the job is skipped there, which counts as passing if the check is made required. CONTRIBUTING.md says how to title a PR and a revert. Settings to apply when this merges: allow squash merging only, in the repository settings, the main ruleset's allowed merge methods and the merge queue's merge method. Under "Allow squash merging", set the default commit message to "Pull request title and description" (API: squash_merge_commit_title PR_TITLE, squash_merge_commit_message PR_BODY). A squash commit then takes the PR title as its subject and the PR description as its message. With the current "Default message", a single-commit PR's squash subject is the commit's subject, which this check does not see. Then add `conventional` (GitHub Actions) to main's required status checks. Merge this before the release-please change of #1395 (#1467), which builds on its CONTRIBUTING.md text. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
robinnsc
force-pushed
the
ci/pr-title-check
branch
from
December 1, 2026 18:55
76701aa to
4d787b1
Compare
hitesh96db
approved these changes
Dec 1, 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.
Release automation (#1395), PR 1 of 6. Stack: #1464 PR title check ← #1465 signing in a called workflow ← #1466 freeze-migrations ← #1467 release-please ← #1468 rehearsal ← #1469 release-publish. Merge in that order.
What
Adds a PR title check, the
conventionaljob of the new "PR title" workflow, which fails when a PR title is not a conventional commit subject:type(scope)!: summary, with the scope and!optional.devtools/check-pr-titleholds the rule and names the part that failed (shape, type, scope, or the space after the colon). The types are commitlint'sconfig-conventionaleleven: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test.devtools/from the default branch, so a PR that edits the checker is checked bymain's version, and an older or stacked PR whose base has no checker still gets one. The workflow file itself runs from the PR's merge ref, as everypull_requestworkflow does, so a change to it is protected by review only. Untilmainhas the checker (this PR and the PRs stacked on it), the job falls back to the PR's own copy, which trusts the PR no more than running the workflow file from its merge ref does. A merge-queue run has no title, so the job is skipped there, which counts as passing.It changes nothing else. It is the first PR of the release automation stack: #1467 extends its CONTRIBUTING.md item.
Why
Part of #1395. The release automation builds the changelog and the next version from the commit subjects on
main. Most subjects already have the conventional shape, but nothing checks it: in the 0.1.15 cycle two squash-merged titles did not, and seven merge commits brought 24 more non-conventional subjects tomain, 20 of them merges into PR branches.Testing done
mainparses with release-please 17.6.0's parser to the same type, scope and breaking flag. On the last 300 subjects onmainit refuses only merge commits, non-conventional subjects anddevtools:types.devtools/check-actions-pinnedare clean.mainhas the checker, the job uses the PR's own copy, so the check also passes on this PR and on the PRs stacked on it.Settings to apply when this merges
An admin applies these, in this order:
mainruleset's allowed merge methods, and the merge queue's merge method.conventional(GitHub Actions) tomain's required status checks. They live in branch protection, not in themainruleset.Checklist
cargo test --workspace): not run, no Rust change; devtools unit tests passcargo fmt --check): no Rust changecargo clippy -- -W clippy::pedantic): no Rust changeStoragetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a: CI and release tooling only; the design is discussed in #1395
Breaking changes
None for users. Contributors' PR titles must follow the format once the check is required.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.