Skip to content

ci: GHA workflow security cleanup - #83

Merged
lawrence-forooghian merged 3 commits into
mainfrom
worktree-fixup-workflows
May 26, 2026
Merged

lawrence-forooghian merged 3 commits into
mainfrom
worktree-fixup-workflows

Conversation

@emptyhammond

Copy link
Copy Markdown
Contributor

Routine hygiene pass over the GitHub Actions workflow 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 permissions explicitly: top-level permissions: {}, with each job granted only the GITHUB_TOKEN scopes it actually needs (contents: read).
  • Pin all third-party actions to commit SHAs (with the tag preserved as a comment) so an upstream tag move can't silently change what runs in CI.

No behavioural changes intended — the workflow runs the same checks against the same inputs.

Workflow security audit finding. The default GITHUB_TOKEN was being
written to the local git config by actions/checkout and persisted for
later steps in the job. Set persist-credentials: false so the token is
not left in the workspace after checkout.
Workflow security audit finding. With no permissions block, jobs
inherit the default GITHUB_TOKEN scopes, which is broader than these
checks require. Set workflow-level permissions: {} and grant each job
only contents: read for actions/checkout.
Workflow security audit finding. Mutable tags like @v2/@v4 can be
re-pointed by upstream, which would silently change what runs in CI.
Pin to the commit SHA those tags resolved to at this point in time,
keeping the tag as a trailing comment for human readability.
@lawrence-forooghian
lawrence-forooghian merged commit aadf2b0 into main May 26, 2026
2 checks passed
@lawrence-forooghian
lawrence-forooghian deleted the worktree-fixup-workflows branch May 26, 2026 14:38
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.

2 participants