ci: set persist-credentials:false on Go CI checkout (Aikido)#1090
Closed
dorothyyzh wants to merge 1 commit into
Closed
ci: set persist-credentials:false on Go CI checkout (Aikido)#1090dorothyyzh wants to merge 1 commit into
dorothyyzh wants to merge 1 commit into
Conversation
actions/checkout v2+ leaves the default GITHUB_TOKEN in .git/config for the rest of the job, where later steps or third-party actions could read it. The Go CI job only builds/tests and never pushes back to the repo, so the token does not need to persist. Sets persist-credentials: false per Aikido SAST finding 'GitHub Action actions/checkout persist Git credentials in workflow'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Go | Jun 29, 2026 7:36a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
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.
Summary
Hardens the
GoCI workflow against the Aikido SAST finding "GitHub Action actions/checkout persist Git credentials in workflow" (Low / SAST).actions/checkout@v2+leaves the defaultGITHUB_TOKENin the repo's local.git/configfor the rest of the job unlesspersist-credentials: falseis set. Subsequent steps or compromised third-party actions could then read it. TheGojob here only builds and tests — it never performs an authenticatedgit pushback to the repo — so the token does not need to persist.Change
.github/workflows/go.yml: addpersist-credentials: falseto theactions/checkoutstep.That's the only change.
submodules: trueis kept (the repo currently has no submodules, but the flag is left untouched); the checkout still fetches everything it needs during the action itself.Verification
Gojob runsgo build ./...+go test ./.... If dependency fetching relied on the persisted checkout token, the build would fail here — so a green run confirmspersist-credentials: falseis safe for this repo.Deployment Note
Skill does not touch
release-*branches. Merging is handled per team policy.