Skip to content

ci: GHA workflow security cleanup#15

Merged
emptyhammond merged 3 commits into
mainfrom
worktree-fixup-workflows
Jun 26, 2026
Merged

ci: GHA workflow security cleanup#15
emptyhammond 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 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 the check job granted only the GITHUB_TOKEN scopes it actually needs (contents: read for checkout, checks: write for dorny/test-reporter).
  • 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.

Audit cleanup: pass persist-credentials: false to actions/checkout so the
default GITHUB_TOKEN is not left in the local git config after checkout.
The workflow does not push or otherwise use the token after checkout.
Audit cleanup: declare top-level permissions: {} so the workflow's
default GITHUB_TOKEN starts with no scopes, and grant the check job
only what it actually needs:

  - contents: read   for actions/checkout
  - checks: write    for dorny/test-reporter to publish results
Audit cleanup: pin each uses: reference to a full commit SHA, with the
resolved tag preserved in a trailing comment, so an upstream tag move
cannot silently change what runs in CI.

  - actions/checkout       v4 -> v4.3.1
  - actions/setup-dotnet   v3 -> v3.4.2
  - dorny/test-reporter    v1 -> v1.9.1
@emptyhammond emptyhammond requested a review from sacOO7 May 27, 2026 16:02
@emptyhammond emptyhammond requested a review from ttypic June 25, 2026 22:09
@emptyhammond emptyhammond merged commit 95eb050 into main Jun 26, 2026
2 checks passed
@emptyhammond emptyhammond deleted the worktree-fixup-workflows branch June 26, 2026 12:49
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