Skip to content

Avoid persisting credentials in workflows - #114

Merged
williammartin merged 1 commit into
mainfrom
wm-zizmor-autofix
May 20, 2026
Merged

williammartin merged 1 commit into
mainfrom
wm-zizmor-autofix

Conversation

@williammartin

Copy link
Copy Markdown
Member

Addresses zizmor findings in .github/workflows/ci.yml and .github/workflows/lint.yml.

Changes

  • Add top-level permissions: contents: read to both workflows (resolves excessive-permissions). Both are read-only CI jobs (go test / golangci-lint) and don't need any write scope on the repo.
  • Add persist-credentials: false to the actions/checkout step in both workflows (resolves artipacked). Neither job uses the git credential after checkout, so dropping it is safe.

Verification

Before:

9 findings (5 suppressed, 2 unsafe fixes): 0 informational, 0 low, 4 medium, 0 high

After:

No findings to report. Good job! (3 suppressed)

Follow-up

A separate PR will bump the action versions (actions/checkout@v2 → v5, actions/setup-go@v3 → v6) and the Go version pinned for the linter job.

Address zizmor findings in ci.yml and lint.yml:

- Add top-level `permissions: contents: read` to both workflows so
  the GITHUB_TOKEN no longer defaults to broad write scopes
  (excessive-permissions).
- Set `persist-credentials: false` on the `actions/checkout` step in
  both workflows so the token is not written into `.git/config` where
  it could be exposed via build artifacts (artipacked).

Both workflows are read-only CI (tests / golangci-lint) and do not
need any write permission on the repo.

Co-authored-by: Copilot <[email protected]>
@williammartin williammartin changed the title ci: harden workflow token permissions Avoid persisting credentials in workflows May 20, 2026
@williammartin
williammartin marked this pull request as ready for review May 20, 2026 11:57
@williammartin
williammartin merged commit 62212fe into main May 20, 2026
33 checks passed
@williammartin
williammartin deleted the wm-zizmor-autofix branch May 20, 2026 12: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.

2 participants