Skip to content

refactor(ci): install the pinned shfmt through one composite action - #15957

Merged
kyle-sexton merged 2 commits into
mainfrom
refactor/setup-pinned-shfmt-action
Nov 13, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
refactor/setup-pinned-shfmt-action

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #15949

session: Simplify E2 A

Summary

Adds .github/actions/setup-pinned-shfmt, a composite action that holds the shfmt version (v3.14.1) and both SHA-256 pins, and calls it from the eight shfmt install steps in pr-test-platforms.yml, pr-require-checks.yml and maintenance-audit-test-selection.yml (restructuring pass #15695). Before, each step carried its own SHFMT_VERSION and SHFMT_SHA256, kept equal by hand through "Same v3.14.1 pin as ..." comments.

Fix

  • New .github/actions/setup-pinned-shfmt/action.yml, shaped like setup-pinned-node: one bash run step that picks the Linux amd64 binary or the Windows amd64 .exe and its SHA-256 by runner.os (any other OS fails with an error). Inputs bin-dir (default $HOME/.local/bin) and cache-dir (optional) reach the script through env:, and a leading ~/ in either is expanded to $HOME/. With cache-dir, it downloads into <cache-dir>/shfmt-v3.14.1 only when that file is missing and copies it to the bin directory, as the required-checks copies did. It then checks the SHA-256, makes the file executable on Linux, adds the bin directory to GITHUB_PATH (through cygpath -w on Windows), and fails unless shfmt --version prints the pin. It takes no token and reads no secret.
  • The eight steps keep the name "Install pinned shfmt" (a babysit test uses it) and their if: conditions, and become uses: ./.github/actions/setup-pinned-shfmt # zizmor: ignore[self-repository]. The three pr-require-checks.yml steps pass cache-dir: ~/.cache/ci-tools, and their actions/cache keys, which name the version, are unchanged.
  • The comments that named the pin by hand now name the action.

Log-only output changes:

  • The test-selection audit's install now adds $HOME/.local/bin to GITHUB_PATH and checks the version.
  • Its curl loses -s for the --no-progress-meter form the other copies use.
  • test-bash no longer prints shfmt --version a second time.

Out of scope, per the issue: the two eval-browser-dispatch.yml copies (R2-3, blocked on this action reaching main), the cache keys, and the cloud installers.

Verification

  • I ran the action's run step locally as a Linux runner would (scratch HOME, GITHUB_PATH file, the real release download), and every case behaved as intended:
    • default bin dir;
    • cache-dir: ~/.cache/ci-tools, both cold and warm, with no download on a warm cache;
    • bin-dir: ~/tools/bin;
    • an unsupported OS, which fails with an error;
    • a corrupted cached file, which fails the SHA-256 check.
  • The Windows path runs in this PR's pr-test-platforms.yml Windows jobs.
  • actionlint on the three workflows: clean. scripts/check-docs-only-gate.sh --check and scripts/check-lane-coverage.sh --check pass, and node scripts/check-artifact-retention.mjs reports 152 upload steps matched.
  • Local test suites:
    • node --test --test-concurrency=4 on the 59 node test files that name these workflows or local actions: 6108/6108 pass.
    • The 36 shell test files that name the workflows: all pass.
    • test_merge_holds_sync.py and test_babysit_postmerge_quarantine.py: 106 passed.
  • Left to CI: the full .github suite (ci-status) and the Windows test jobs.

Related

Part of restructuring pass #15695 (child R2-1 of the /simplify epic). Unblocks R2-3, which moves the eval-browser-dispatch.yml copies onto this action.

🤖 Generated with Claude Code

Add .github/actions/setup-pinned-shfmt, which holds the shfmt version
and both SHA-256 pins (Linux amd64 binary, Windows amd64 .exe), picked
by runner.os. It takes an optional bin-dir and cache-dir, expands a
leading ~/ in either, checks the hash, puts the bin dir on GITHUB_PATH
(through cygpath -w on Windows) and fails unless shfmt --version prints
the pin.

The eight install steps in pr-test-platforms.yml (4 Windows jobs),
pr-require-checks.yml (check-plugins, check-skills, test-bash, with
cache-dir ~/.cache/ci-tools) and maintenance-audit-test-selection.yml
now call it, keeping their names and if: conditions, and the comments
that kept the copies equal by hand name the action instead.

Closes #15949

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 13, 2026 12:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T12:45:44.700967Z 80130aa Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 4f1abda94ee8cae30968dbd2986e4626e05b802e: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15957 (incremental, head 4f1abda)

I found no security issues in this push. This was an incremental review: it covered only the change since 80130aac, and only blocking findings would have been posted, because this lane already reviewed an earlier head.

What changed. One line changed in .github/actions/setup-pinned-shfmt/action.yml#L1: the action's display name went from Setup Pinned shfmt to Setup Pinned Shfmt. I read the whole incremental diff, which is 1 of 1 scoped files.

What I checked.

  • The name: field of a composite action is only a display label.
  • The download URL, SHA-256 pins, inputs, env: wiring and run steps did not change. The checks in the previous review still hold.
  • This file is not a trusted path. It widens no trust control, merge hold, token scope or kill switch.

Prior findings. The previous review on this PR reported 0 findings, so there was nothing to carry forward.

Spend: none.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 4f1abda94ee8cae30968dbd2986e4626e05b802e: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): no findings

Scope: the changes since 80130aac. That is one file, .github/actions/setup-pinned-shfmt/action.yml, and I read its whole change.

What changed:

  • One line: the action's name: goes from Setup Pinned shfmt to Setup Pinned Shfmt, matching the Title Case of its directory name.
  • The run step, inputs, pins and behaviour are unchanged.

References to the name:

  • I searched the repository for both spellings, and nothing else uses the action's display name.
  • The callers use the path ./.github/actions/setup-pinned-shfmt.
  • The babysit test checks the calling step's name, "Install pinned shfmt", which this change does not touch.

The rename therefore affects no caller, test or acceptance criterion of #15949. The earlier review at 80130aac covered the other files and the closing issue's criteria; all of them are unchanged since then.

Other notes:

  • This review was blocking only, because this lane already reviewed an earlier head. It found no blocking issues.
  • I found no embedded instructions in the PR context or the prior-findings file.
  • Spend: none beyond this review run.

Verifier dropped 0 of 0 candidates.

The org naming lint requires an action's `name:` to equal the Title
Case form of its directory: `Setup Pinned Shfmt`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit a6a36f5 Nov 13, 2026
68 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/setup-pinned-shfmt-action branch November 13, 2026 13:24
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install the pinned shfmt through one composite action

1 participant