Don't persist GitHub authentication token in .git/config on CI
#2187
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.
When
actions/checkoutis used to check out the repository on CI, it persists credentials related to the GitHub token in the local scope configuration at.git/config, unlesspersist-credentialsis explicitly set tofalse. This facilitates subsequent remote operations on the repository that could otherwise fail, but we have no such operations in any of our workflows.As an added layer of protection to keep these credentials from leaking into logs (or otherwise being displayed or subject to exfiltration) in case there is ever unintended coupling between the operation of the test suite (or any step subsequent to checkout that is used to prepare or run tests or other checks) and the cloned
gitoxiderepository itself, this:persist-credentials: falsein awithmapping on every step that usesactions/checkout.actions/checkoutstep in any job in any workflow setspersist-credentialstofalse.In addition to usual testing on CI, the
release.ymlworkflow is among the workflows changed here, and it has also been tested: https://github.com/EliahKagan/gitoxide/actions/runs/17899238656See also:
(covers what happens with/without
persist-credentials: false)persist-credentialsor change the default tofalseactions/checkout#485