Skip to content

Install the pinned shfmt through one composite action #15949

Description

@kyle-sexton

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, .exe into $HOME/.local/bin, then cygpath -w onto GITHUB_PATH: 4 copies, pr-test-platforms.yml:208-218, :366-377, :411-421, :507-517. They are identical except the if: at :367.
  • Linux, through ~/.cache/ci-tools/shfmt-$SHFMT_VERSION (an actions/cache step keyed on the version restores it): 3 copies, pr-require-checks.yml:2873-2887, :3160-3175, :3589-3604. The :3589 copy also exports PATH and prints shfmt --version.
  • Linux, straight into $HOME/.local/bin with curl -fsSL, no GITHUB_PATH line 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 on pull_request from 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:1432 maps to ./;
  • the required-checks jobs check-plugins, check-skills and test-bash, through ./.github/actions/setup-pinned-node and download-full-history (for example pr-require-checks.yml:3589 sits 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 one bash run step. It holds the version and both SHA-256 values (the Linux amd64 binary and the Windows amd64 .exe), picked by runner.os.

  • It takes two inputs, both with an empty default, passed to the run step through env:, never as ${{ inputs.* }} inside run::

    • 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/cache expands ~ itself, but a quoted shell variable does not.

  • It checks the SHA-256, makes the file executable on Linux, and puts bin-dir on GITHUB_PATH (through cygpath -w on Windows). It ends by failing unless shfmt --version prints 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 becomes uses: ./.github/actions/setup-pinned-shfmt with the # zizmor: ignore[self-repository] comment the other local action calls carry. The three required-checks steps pass cache-dir: ~/.cache/ci-tools.

  • The actions/cache keys that name v3.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_PATH line and the version check;
    • its curl loses -s, gaining the --no-progress-meter form;
    • the test-bash copy no longer prints the version a second time.

    Say so in the PR body.

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 PATH in 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.sh hook and the cloud bootstrap installer, other duplication, eval cases, fixtures, and skill and agent text.

Activity

  1. added
    status: ready
    host-run
    on Nov 13, 2026
  2. added theissue type on Nov 13, 2026
  3. removed
    status: ready
    on Nov 13, 2026
  4. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    The triage sweep dispatched intake triage for this issue (dispatch 1; 2 runs that reach intake, or 6 dispatches, hand it to a maintainer).

  5. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none

    I understood this as a bounded refactor. Add a setup-pinned-shfmt composite 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.

  6. removed
    host-run
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    ready

    Priority

    low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions