Skip to content

ci(pr-title): require a scope - #122

Merged
NSchatz merged 1 commit into
mainfrom
ci/pr-title-require-scope
Nov 11, 2026
Merged

NSchatz merged 1 commit into
mainfrom
ci/pr-title-require-scope

Conversation

@NSchatz

@NSchatz NSchatz commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

What

pr-title.yml now requires the scope in a pull request title: type(scope): description. The optional ! stays after the scope. The header comment, the error message, README.md, CONTRIBUTING.md and CHANGELOG.md (Unreleased) say the scope is required, with an example. test/pr-title.test.mjs covers the new rule.

Old pattern:

^(feat|fix|docs|chore|ci|build|refactor|test|perf|revert|style)(\([a-z0-9][a-z0-9._/-]*\))?!?: [^[:space:]]

New pattern:

^(feat|fix|docs|chore|ci|build|refactor|test|perf|revert|style)\([a-z0-9][a-z0-9._/-]*\)!?: [^[:space:]]

The title still reaches the shell through env: only; the job still takes no input, checks nothing out and runs no action.

Why

Merged commits on main read both perf: ... and perf(parser): .... We want every pull request title, and so every squash commit, to read type(scope): description. Each repo takes the rule when its pin of this workflow moves to a reference that carries this change; nothing changes in a caller before that.

Proof

  • harness gate github-profile --fast: passed, 4 of 4 (actionlint, node --test, em-dash scan, package lists).
  • test/pr-title.test.mjs against the old workflow: 4 failures (the no-scope titles are accepted, and every type with no scope). With the change: 53 pass, 0 fail.
  • Cases run through the workflow's own step:
    • refused: fix: keep the escape sequence in OBX-5, feat!: require Node 22 or later, chore: bump actions/checkout from 7.0.1 to 7.1.0, and each of the 11 types with no scope;
    • accepted: fix(parser): keep the escape sequence in OBX-5, refactor(reader)!: one fail-closed reader, each of the 11 types with a scope;
    • accepted: chore(release): version packages, which release.yml writes (read from the file and run through the step);
    • accepted: chore(deps): bump actions/checkout from 7.0.1 to 7.1.0 and the capitalised chore(deps): Bump ..., the shape Dependabot writes with prefix: chore and include: scope.
  • The sibling Dependabot configs read (hl7, x12, fhir) all set prefix: chore and include: scope.

Choices

  • The anchor-mutation test now uses a title that has a scope inside the quoted text, because without a scope even the loosened pattern refuses the old example.
  • To undo: revert this commit; the old pattern is in the diff.

Kind: code

The shared title check now requires type(scope): description. The optional ! stays after the scope. Tests cover no scope (refused), a scope (accepted), chore(release): version packages and the Dependabot title shape.
@NSchatz
NSchatz merged commit 398cd4d into main Nov 11, 2026
40 checks passed
@NSchatz
NSchatz deleted the ci/pr-title-require-scope branch November 11, 2026 02:40
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.

1 participant