Repository navigation
Avoid persisting credentials in workflows - #114
Merged
Merged
Conversation
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
marked this pull request as ready for review
May 20, 2026 11:57
babakks
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses zizmor findings in
.github/workflows/ci.ymland.github/workflows/lint.yml.Changes
permissions: contents: readto both workflows (resolvesexcessive-permissions). Both are read-only CI jobs (go test/golangci-lint) and don't need any write scope on the repo.persist-credentials: falseto theactions/checkoutstep in both workflows (resolvesartipacked). Neither job uses the git credential after checkout, so dropping it is safe.Verification
Before:
After:
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.