Skip to content

ci: harden test.yaml and docs.yaml for zizmor - #767

Open
tyler-reitz wants to merge 1 commit into
mainfrom
chore/harden-workflows
Open

ci: harden test.yaml and docs.yaml for zizmor#767
tyler-reitz wants to merge 1 commit into
mainfrom
chore/harden-workflows

Conversation

@tyler-reitz

Copy link
Copy Markdown
Contributor

Split out of #766 at @jhuleatt's request, so that PR can stay focused on the release checks. Covers docs.yaml too, as he asked.

This is a pre-existing, repo-wide condition rather than anything #766 introduced. The zizmor scan only runs when a workflow file changes, so it fires against whatever state the file was already in.

Changes

  • All 14 action references pinned to commit SHAs, with the resolved release in a trailing comment so versions stay legible and Dependabot can still bump them. Clears unpinned-uses, the only mandatory audit.
  • Top-level permissions: contents: read on both workflows. Neither writes to the repo through GITHUB_TOKEN; the publish job authenticates to npm separately. Clears excessive-permissions.
  • persist-credentials: false on all four checkouts. The token is not needed after the clone, and leaving it in .git/config exposes it to every later step. Clears artipacked.

Result

Measured with the version CI pins (1.25.2):

Before After
test.yaml 8 medium, 17 high 0 medium, 5 high
docs.yaml 2 medium, 2 high no findings

CI fails on Medium or higher, so partial fixes would not clear it.

The 5 remaining findings on test.yaml are all cache-poisoning, which the org scan suppresses. Fixing those means restructuring how the workflow caches around the publish path, which does not belong here.

Notes

No functional change to any job. 32 lines across two files.

Verified that main's switch of the publish registry to wombat-dressing-room.appspot.com (fcbfe83) is preserved, since the pinning touches that same setup-node block.

🤖 Generated with Claude Code

Split out of #766 at Jeff's request, so that PR can stay focused on the release
checks. This is a pre-existing, repo-wide condition rather than anything the
gate introduced: the zizmor scan only runs when a workflow file changes, so it
fires against whatever state the file was already in.

Both workflows, since he asked for docs.yaml too:

- **All 14 action references pinned to commit SHAs**, with the resolved release
  in a trailing comment so versions stay legible and Dependabot can still bump
  them. Clears `unpinned-uses`, the only mandatory audit.
- **Top-level `permissions: contents: read`.** Neither workflow writes to the
  repo through GITHUB_TOKEN; the publish job authenticates to npm separately,
  now via the Google npm service. Clears `excessive-permissions`.
- **`persist-credentials: false` on all four checkouts.** The token is not
  needed after the clone, and leaving it in .git/config exposes it to every
  later step. Clears `artipacked`.

Result, measured with the version CI pins (1.25.2):

    test.yaml   8 medium, 17 high  ->  0 medium, 5 high
    docs.yaml   2 medium,  2 high  ->  no findings at all

CI fails on Medium or higher, so partial fixes would not have cleared it. The 5
remaining findings on test.yaml are all `cache-poisoning`, which the org scan
suppresses; fixing those means restructuring how the workflow caches around the
publish path and does not belong here.

No functional change to any job. Verified that main's switch of the publish
registry to wombat-dressing-room is preserved.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@tyler-reitz
tyler-reitz requested a review from jhuleatt July 29, 2026 23:15
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