šŸ› fix: the checks run their own commit's CLI, and fail a half-bumped pin pair

Merged
AT
25d ago
+233-33

Fixes the half-bump in #168 at its cause: the shared checks now run their own commit's CLI, and a pin pair that disagrees fails Settings with its fix.

Cause. Each client job pins the release twice, checks.yml@vX and process-rules-ref: vX. Dependabot's github-actions updater (reusable workflows since its 2023-03-13 changelog) and Renovate's github-actions manager rewrite uses: lines only; a with: input is an opaque string to them. So #168 moved the three uses: lines to v0.5.24 and left process-rules-ref (and the header) at v0.5.19: v0.5.24's workflow would have run the v0.5.19 CLI, every check green. Any client running Dependabot or Renovate on github-actions gets the same half-bump. doctor reads the pins only in a cloud session (ā–² "pins no one version"), and nothing on the pull request did.

Fix.

  • Every job of checks.yml checks the CLI out at ${{ job.workflow_sha }} from ${{ job.workflow_repository }}, which is GitHub's documented way for a reusable workflow to check out its own source, and what GitHub's github/gh-aw does. The checks and the CLI are always one release now, whatever process-rules-ref says. Where GitHub gives neither (Enterprise Server), it falls back to process-rules-ref, as before.
  • Settings, which runs on every event, fails a run whose process-rules-ref names another release (by version, or by commit for a commit pin). The error names the caller's workflow file, both versions and the fix: run onboard again, or set process-rules-ref on every job. A branch ref passes and says which release ran. On github.com, an empty job.workflow_sha gets a warning, because without it the check can't compare.
  • .github/actionlint.yaml ignores actionlint's property "workflow_(sha|repository)" is not defined in checks.yml alone. actionlint 1.7.12, and its main branch too, doesn't know these properties yet (rhysd/actionlint#707).
  • A bot's bump is never a whole upgrade anyway. It skips the cloud setup file's pin and any job a newer release adds (this repo's v0.5.19 file had no needs-owner job). So this repo's Dependabot now ignores athya-hq/process-rules*, and the README tells clients to do the same and to upgrade through onboard.
  • This repo's process-rules.yml is onboard's template at v0.5.32, the newest release on main: workflow('main', '0.5.32', false), which is exactly what workflowUpdate returns for the old file. It now has the needs-owner job.
  • Keeps #168's pnpm/action-setup v6.1.0 → v6.1.1 in ci.yml and release.yml.

Rejected. One pin per job, with the process-rules-ref line dropped from the template: onboard's repin counts two pins per job in every client file, so that's its own onboard change, once clients run a release that has this check. A warning instead of a failure: nobody reads a green run's warnings. Doctor alone: it runs in a session, not on the bot's pull request. Recorded in docs/decisions.md.

Not live until the next release. This repo pins v0.5.32, so its own runs use the old checks.yml until the next release is tagged and process-rules.yml is repinned from the template. Clients get the check at the release that contains it.

Tests: src/checks.test.ts checks that every CLI checkout uses job.workflow_sha. It also runs the Settings check's script against a fake release: a matching ref by version, full commit and short commit; a Dependabot-stale ref by version and by commit; a branch; and an empty job.workflow_sha on github.com and on another server. pnpm check passes (1030 tests), and actionlint 1.7.12 is clean with the new config.

State #195 of P-11 (#33): P-11 promised "upgrading is one pin change", and this restores it.

Slice: #33

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes the half-bumped pin pair from #168 at its cause: bot updaters rewrite only a reusable workflow's uses: line, leaving process-rules-ref stale, so checks ran the older release's CLI. Checks now run their own commit's CLI, and Settings fails a run whose pin pair disagrees. This repo's own runs still use the old checks until the next release is tagged, since its process-rules.yml pins v0.5.32.

  • Every checks.yml job checks out the CLI at job.workflow_sha from job.workflow_repository; on GitHub Enterprise Server, which has neither, it falls back to process-rules-ref.
  • Settings fails a run whose process-rules-ref names another release, naming the caller's workflow file and the fixes: rerun onboard or set the ref on every job. The guard reads a release only in the vX.Y.Z shape and a commit only as a full sha, as uses: lines take them; any other ref is a branch, which passes and says which release ran.
  • This repo's process-rules.yml is onboard's template at v0.5.32, which adds the needs-owner job; Dependabot here ignores athya-hq/process-rules*, and the README tells clients to do the same.
  • .github/actionlint.yaml ignores actionlint's unknown workflow_(sha|repository) property error in checks.yml alone.
  • Keeps #168's pnpm/action-setup v6.1.0 → v6.1.1 bump in ci.yml and release.yml.