Skip to content

feat(pr-checks): a reusable workflow checks each pull request, starting with its title - #21

Draft
PiquelChips wants to merge 1 commit into
feat/readme-standardfrom
feat/pr-checks
Draft

PiquelChips wants to merge 1 commit into
feat/readme-standardfrom
feat/pr-checks

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What and why

Some rules of the standard are about the pull request itself, not the code: its title, its description, its commits, the exceptions it adds. Each repository would otherwise copy those checks into its own CI. This adds them here as one reusable workflow, .github/workflows/pr-checks.yml, that each repository calls from a small pr.yml. The first check is pr-title (G2). The pull requests stacked on this one add the others.

  • pr-title: the title must be type(scope)!: subject. The type is one of feat fix refactor docs test chore ci perf build revert, and the scope, if any, one the caller allows in its scopes input. A finding names what's wrong, shows the expected form and gives an example in an allowed scope. It then says how to challenge the check, as the crate's violations do.
  • Cheap: the job doesn't check out the pull request's code and installs no toolchain. It reads the pull request with pulls.get, so a re-run sees the current title, not the one from the original event. Actions are pinned by SHA, and permissions is contents: read plus pull-requests: read, with timeout-minutes on every job.
  • One check per matrix entry, one module each. The logic lives in .github/pr-checks/ as Node scripts with no dependencies. The workflow checks them out sparsely from this repository at job.workflow_sha, so a caller pins one SHA and gets matching scripts. actions/github-script runs them.
  • Challenging a check: a deviations input of check = "why" lines turns that check's findings into notices, like standard.toml's [deviations]. An unknown check name or an empty reason fails.
  • Required check: the workflow ends in a pr-checks job that the ruleset requires, beside ci. A merge group passes it, since its pull requests already passed.
  • Dogfooded from this repository's .github/workflows/pr.yml. CI's new pr-check-scripts job runs just test-pr-checks. tools/xtask/src/ci.rs and filters.yml changed to match.
  • Rebased on the amended feat/readme-standard: CI's pr-check-scripts job is in the tools/xtask/src/ci.rs table, which the drift check now compares recipe by recipe.
  • The crate's README gains adoption step 5 (the two required checks) and a "Pull request checks" section: the caller workflow, its inputs, the required check, and a CODEOWNERS entry for standard.toml, budget.toml, clippy.toml and deny.toml. AGENTS.md lists the workflow and adds it to Surfaces.

Two required checks (the owner accepted this): a repository's ruleset requires ci, for the code, and standard / pr-checks, for the pull request. The checks can't go into ci: edits, labels and reviews re-run them, and ci.yml re-running on those events would either rebuild everything or replace a failed ci with a run that skipped the code. The README's adoption section says so.

Testing

  • just check-changed origin/feat/readme-standard passes: fmt, audit, unused, standard (so the new YAML stays within config-comments), lint, doc, test (ci_matches_the_workflow included), doc-test, package and test-pr-checks.
  • 15 Node tests cover:
    • the TOML reader used for deviations, which later checks reuse for manifests;
    • title parsing: shape, type and scope;
    • the runner: a failing finding, a pass, a deviation turned into a notice, a bad deviation, and the path:line: prefix.
  • Dogfood: this pull request's own PR run checks its title.
  • Not run: actionlint, which isn't installed here.

Checklist

  • The crate's README (its documentation on docs.rs) shows the change, and a repository's xtask can still follow it.
  • A change to the public API is noted for the next release, with what each repository's xtask must change. (No API change. Each repository adds .github/workflows/pr.yml and the required check standard / pr-checks.)
  • just check-changed passes.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

…ng with its title

Adds .github/workflows/pr-checks.yml, which each repository calls from a
small workflow, with its first check, pr-title (G2): titles are Conventional
Commits of the standard's types and the scopes the repository allows. The
logic lives in .github/pr-checks as Node scripts without dependencies,
tested by just test-pr-checks in CI, and this repository dogfoods the
workflow from pr.yml.
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