Repository navigation
Description
Agent Brief
Type: Task
Summary: Add a setup-pinned-shfmt composite action that holds the shfmt version and both SHA-256 pins, and call it from the eight shfmt install steps in the test-platform, required-checks and test-selection-audit workflows (part of restructuring pass #15695).
Current behavior:
Line numbers are at ba7bb0da37. The pinned shfmt install (v3.14.1) is written out 10 times in 4 workflows, in four forms. Each carries its own SHFMT_VERSION and SHFMT_SHA256, and comments keep them equal by hand ("Same v3.14.1 pin as ...", pr-test-platforms.yml:205, eval-browser-dispatch.yml:563):
- Windows,
.exeinto$HOME/.local/bin, thencygpath -wontoGITHUB_PATH: 4 copies,pr-test-platforms.yml:208-218,:366-377,:411-421,:507-517. They are identical except theif:at:367. - Linux, through
~/.cache/ci-tools/shfmt-$SHFMT_VERSION(anactions/cachestep keyed on the version restores it): 3 copies,pr-require-checks.yml:2873-2887,:3160-3175,:3589-3604. The:3589copy also exportsPATHand printsshfmt --version. - Linux, straight into
$HOME/.local/binwithcurl -fsSL, noGITHUB_PATHline and no version test: 1 copy,maintenance-audit-test-selection.yml:93-102. - Linux into
/opt/tools/bin: 2 copies,eval-browser-dispatch.yml:566-578,:1430-1442. They are left to R2-3, which is blocked by this item: that workflow runs onpull_requestfrom main's.base, so the action must be on main first.
#15863 handed this to the pass: a shared shfmt composite action, covering the test-platform copies and the three other workflows above.
The eight copies in scope sit in jobs that check the repository out at the workspace root and already call local actions as ./.github/actions/...:
- the test-platform Windows jobs, which
.github/actions/log-api-budget/log-api-budget.test.mjs:1432maps to./; - the required-checks jobs
check-plugins,check-skillsandtest-bash, through./.github/actions/setup-pinned-nodeanddownload-full-history(for examplepr-require-checks.yml:3589sits under both).
So on a pull request the action comes from the head, and this item's own PR runs it. Precedent for the shape: .github/actions/setup-pinned-node/action.yml.
Desired behavior:
-
New
.github/actions/setup-pinned-shfmt/action.yml, a composite action with onebashrun step. It holds the version and both SHA-256 values (the Linux amd64 binary and the Windows amd64.exe), picked byrunner.os. -
It takes two inputs, both with an empty default, passed to the run step through
env:, never as${{ inputs.* }}insiderun::bin-dir: the script uses${BIN_DIR:-$HOME/.local/bin};cache-dir, optional: when set, it downloads into<cache-dir>/shfmt-<version>only if that file is missing, then copies it to the bin directory, as the required-checks copies do now.
-
The script expands a leading
~/in either value to$HOME/.actions/cacheexpands~itself, but a quoted shell variable does not. -
It checks the SHA-256, makes the file executable on Linux, and puts
bin-dironGITHUB_PATH(throughcygpath -won Windows). It ends by failing unlessshfmt --versionprints the pinned version. -
It uses
curl -fSL --no-progress-meter --retry 7 --retry-all-errors, as nine of the ten copies do. -
Each of the eight steps in scope keeps its name "Install pinned shfmt" and its
if:, and becomesuses: ./.github/actions/setup-pinned-shfmtwith the# zizmor: ignore[self-repository]comment the other local action calls carry. The three required-checks steps passcache-dir: ~/.cache/ci-tools. -
The
actions/cachekeys that namev3.14.1(pr-require-checks.yml:2872,:3159,:3588) stay; the comment above each install names the action instead of "Same v3.14.1 pin as ...". -
Output changes, all of them visible in the log only:
- the test-selection audit's install gains the
GITHUB_PATHline and the version check; - its
curlloses-s, gaining the--no-progress-meterform; - the
test-bashcopy no longer prints the version a second time.
Say so in the PR body.
- the test-selection audit's install gains the
Files:
.github/actions/setup-pinned-shfmt/action.yml(new)- the install steps at
pr-test-platforms.yml:208,:366,:411,:507 - the install steps at
pr-require-checks.yml:2873,:3160,:3589 - the install step at
maintenance-audit-test-selection.yml:93
Key interfaces:
- The step name "Install pinned shfmt" stays: a babysit test uses that step name (
plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_postmerge_quarantine.py:599). - Token scope: the action takes no token and reads no secret. A composite step nests its log under the calling step.
- Composite steps take no
timeout-minutes, and none of the eight copies sets one.
Acceptance criteria:
- The shfmt version and its two SHA-256 values appear once among the files this item edits, in
.github/actions/setup-pinned-shfmt/action.yml; the cache keys keep their version string. - The eight install steps in scope call the action and keep their names and
if:conditions. - shfmt v3.14.1 ends up on
PATHin every job that installed it before: the Windows test jobs, the three required-checks jobs and the test-selection audit. - Every job id, trigger, permission and workflow file name is unchanged.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines and 15 hand-edited files.
- ci-status is green, and the Windows test jobs that install shfmt pass on this pull request.
Out of scope:
- The two eval-dispatch copies (R2-3 moves them), the cache keys, the guardrails
cloud-shfmt.shhook and the cloud bootstrap installer, other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity
github-actions commentedon Nov 13, 2026
The triage sweep dispatched intake triage for this issue (dispatch 1; 2 runs that reach intake, or 6 dispatches, hand it to a maintainer).
github-actions commentedon Nov 13, 2026
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
I understood this as a bounded refactor. Add a
setup-pinned-shfmtcomposite action that holds the shfmt v3.14.1 version and both SHA-256 pins. Then call it from the eight install steps in the test-platform, required-checks and test-selection-audit workflows. The brief states the done-when items, so I found no open design question. I found no open issue that duplicates it and no merged pull request that already does it. It is part of the restructuring pass in #15695.Automated triage. A maintainer reviews it.