Skip to content

ci: GHA workflow security cleanup#483

Open
emptyhammond wants to merge 3 commits into
mainfrom
worktree-fixup-workflows
Open

ci: GHA workflow security cleanup#483
emptyhammond wants to merge 3 commits into
mainfrom
worktree-fixup-workflows

Conversation

@emptyhammond
Copy link
Copy Markdown

@emptyhammond emptyhammond commented May 27, 2026

Routine hygiene pass over the GitHub Actions workflows in this repo, addressing findings from a workflow security audit. Changes are split into three commits, one per finding type:

  • Disable credential persistence on actions/checkout steps so the default GITHUB_TOKEN is not left in the local git config after checkout.
  • Scope each job's GITHUB_TOKEN permissions explicitly: top-level permissions: {}, with each job granted only the scopes it actually needs (contents: read for both, plus deployments: write / id-token: write for the build job's preview upload.
  • Pin all third-party actions to commit SHAs (with the tag preserved as a trailing comment) so an upstream tag move can't silently change what runs in CI.

No behavioural changes intended — the workflows run the same checks against the same inputs.

Prevents the default GITHUB_TOKEN from being written into the local
git config after checkout, where later steps could read or exfiltrate it.
This is a routine hardening step following a workflow security audit.
Add a workflow-level permissions: {} default and grant each job only the
GITHUB_TOKEN scopes it actually needs (contents: read for checkout in both
workflows, plus deployments: write and id-token: write for the build job's
preview upload). Follow-up to a workflow security audit; no functional
change to the steps themselves.
Replace floating major-version tags (e.g. actions/checkout@v4) with the
exact commit SHA they currently resolve to, preserving the version as a
trailing comment. This is the standard mitigation for the supply-chain
risk of upstream tag moves silently changing what runs in CI, and was
flagged by a workflow security audit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant