Repository navigation
Commit f130dd3
ci: fail if any
Every `actions/checkout` step now sets `persist-credentials: false`.
zizmor reports any that do not as `artipacked`, but only as code
scanning alerts: it does not fail CI. A checkout that persists the
`GITHUB_TOKEN` should fail CI, because it is riskier in this
repository than in most. GitPython performs Git operations, and its
test suite reads, clones, and runs Git commands against the
repository it is tested in. That coupling may be intended or not, and
it can let a test or library bug use or expose a persisted token.
Add a `check-no-persist-credentials` job to the `Lint` workflow. It
sparse-checks out `.github/workflows`, without persisting credentials
itself, and uses `yq` to list every step in every workflow file that
uses `actions/checkout` without `persist-credentials: false`. This
includes a step with no `with:` block, a `with:` block without the
input, and any other value. The job fails if anything is listed and
prints each match as `file:line: name`.
This is the same code as the job of the same name in gitoxide's CI
(`.github/workflows/ci.yml`), copied from its current version. The
only change is indentation, to match the step style of `lint.yml`.
gitoxide's job also gates its `tests-pass` job, but this repository
has no such aggregate job.
The check does not replace zizmor's `artipacked` audit, which also
looks for ways persisted credentials could end up in uploaded
artifacts, and whose findings are tracked as code scanning alerts.
Run locally with `yq` 4.54.1, the scan reports nothing for the
workflows in this commit. In a scratch copy, removing the setting
from both checkouts in `pythonpackage.yml` (one with other inputs and
one with no `with:` block) and setting it to `true` in `lint.yml`
made it report exactly those four steps and fail. A quoted `"false"`
is not reported, which is correct, since action inputs are strings
and `actions/checkout` treats it the same as `false`.
`actionlint` reports two `info`-level SC2086 notes from `shellcheck`,
for the unquoted `$GLOB`. Pathname expansion there is intended, as the
inline comments say, so they are left as they are in gitoxide.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>actions/checkout step persists credentials1 parent 63f42c9 commit f130dd3
1 file changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments