Commit f7a40a4
ci(anchor-drift): stop persisting credentials on all six checkout steps (CWE-522) (#55)
Closes #53.
## What this fixes
`.github/workflows/anchor-drift.yml` has **six** `actions/checkout`
steps and, on
`main`, **zero** `persist-credentials` settings — so all six fall back
to the
action's default of `true`, leaving the job token in `.git/config` for
every
subsequent step (CWE-522).
No job in this workflow pushes or otherwise uses the token, and it runs
on
`pull_request` executing repository-controlled code, so the persisted
credential
is exposure with no upside.
## Why it wasn't fixed in #52
This exact commit (`6a5d1a7`) was written as part of PR #52 but
**rejected at push
time**, because the acting token then lacked the `workflow` OAuth scope:
```
! [remote rejected] (refusing to allow an OAuth App to create or update workflow
'.github/workflows/anchor-drift.yml' without 'workflow' scope)
```
That rejection fails the *whole* push if any single commit touches a
workflow
path, so the validator commit landed while this one did not — which is
why #52
looked complete and was merged around the gap. The scope has since been
granted,
so it is cherry-picked here onto current `main`.
## Verification
Checked semantically by parsing the YAML rather than grepping, so a
comment or a
near-miss key cannot pass:
```
YAML parses OK; checkout steps = 6 ; steps still persisting = []
```
Before, on `main`: 6 checkout steps, 0 `persist-credentials` lines.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QNjWX2B4FffG7zqMBMui6v
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 7b7b379 commit f7a40a4
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
55 | 67 | | |
56 | 68 | | |
57 | 69 | | |
| |||
69 | 81 | | |
70 | 82 | | |
71 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| |||
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
91 | 115 | | |
92 | 116 | | |
93 | 117 | | |
| |||
97 | 121 | | |
98 | 122 | | |
99 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
| |||
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
121 | 157 | | |
122 | 158 | | |
0 commit comments