Skip to content

ci: GHA workflow security cleanup - #62

Merged
emptyhammond merged 3 commits into
mainfrom
worktree-fixup-workflow
Jun 25, 2026
Merged

emptyhammond merged 3 commits into
mainfrom
worktree-fixup-workflow

Conversation

@emptyhammond

Copy link
Copy Markdown
Contributor

Routine hygiene pass on .github/workflows/check.yaml from a workflow security audit. Split into one commit per finding type:

  • Credential persistence — actions/checkout now sets persist-credentials: false so GITHUB_TOKEN isn't left in the local git config after checkout.
  • Permissions scoping — added a top-level permissions: {} and granted the check job only contents: read, instead of relying on the repo's default token scopes.
  • Action pinning — actions/checkout and actions/setup-node are now pinned to the commit SHA their v2 tag currently points to, with # v2 kept as a trailing comment for readability.

No behavioural changes intended.

Prevents the default GITHUB_TOKEN from being left in the local git config
after actions/checkout, so subsequent steps cannot inadvertently reuse it.
Sets a top-level permissions: {} so the GITHUB_TOKEN starts with no
scopes, and grants the check job only the contents: read scope it
needs to clone and lint the repository.
Pins actions/checkout and actions/setup-node to the commit SHA each tag
currently resolves to, with the tag preserved as a trailing comment so
the intent stays readable. Prevents an upstream tag move from silently
changing what runs in CI.
@emptyhammond
emptyhammond requested a review from ttypic May 26, 2026 13:40
@emptyhammond
emptyhammond merged commit 3c28ea1 into main Jun 25, 2026
1 check passed
@emptyhammond
emptyhammond deleted the worktree-fixup-workflow branch June 25, 2026 21:17
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