You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 63f42c9
Browse filesBrowse the repository at this point in the historyBrowse files
ci: stop actions/checkout from persisting credentials
By default, `actions/checkout` persists the job's `GITHUB_TOKEN` so
later Git commands can use it. Since v6, it writes the token to a
credentials file under `$RUNNER_TEMP` and adds `includeIf` entries
that include that file to the checked-out repository's `.git/config`.
Nine checkout steps did this, in `alpine-test.yml`, `codeql.yml`,
`cygwin-test.yml`, `dependencies.yml`, `git-cli.yml` (twice, including
the `git/git` checkout in `.git-source`), `lint.yml`, and
`pythonpackage.yml` (twice). zizmor reports these as `artipacked`.
No step in these jobs needs the token after checkout. They push
nothing, and their only network Git operations are reads of public
repositories, which need no credentials. The other checkouts, in
`backend-benchmark.yml`, `downstream.yml`, the `uv-sync` job in
`dependencies.yml`, and `zizmor.yml`, already use
`persist-credentials: false`.
Keeping the token is also riskier here than in most projects. GitPython
runs Git operations, and its test suite uses this checkout as a
repository: the tests read it, clone it, and run Git commands against
it. A test or library bug could then use the token, or expose the
configuration that refers to it, whether through test output or a
retained artifact such as `pythonpackage.yml`'s test results. The
`includeIf` entries and the configuration they include can also
change how Git behaves in it, coupling test results to how CI checked
out the code.
Set `persist-credentials: false` on every checkout that lacked it. It
is added to the existing `with:` block where there is one, after the
other inputs, as in `backend-benchmark.yml`. The disabled
`codeql.yml` workflow is included, so it is safe if it is enabled
again.
zizmor 1.31.1 at the `pedantic` level no longer reports any
`artipacked` findings. `actionlint` reports no problems.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments