Repository navigation
Commit e2d19ac
ci(codeql): set empty workflow permissions and document the job's
zizmor reports two findings in `codeql.yml`:
- `excessive-permissions`: the workflow has no top-level
`permissions:`, so any job without its own would get the
repository's default `GITHUB_TOKEN` permissions.
- `undocumented-permissions`: the `analyze` job's
`security-events: write` has no comment saying why it is needed.
The only job already sets its own permissions, so the first finding
describes no current excess. But a job added later without its own
`permissions:` would silently get the defaults, and every other
workflow here sets top-level permissions.
Add `permissions: {}` at the top level, noting that the `analyze` job
expands it, and explain that `security-events: write` is needed to
upload SARIF results for the Security tab. The job's effective
permissions do not change. The wording matches gitoxide's
`codeql.yml`, which made the same changes for the same zizmor
findings. Unlike there, no comment is added about permissions that
the job does not need; those were removed here earlier as
unnecessary.
The workflow is disabled while CodeQL default setup is enabled, but it
is still tracked and may be enabled again.
zizmor 1.31.1 at the `pedantic` level no longer reports either
finding. `actionlint` reports no problems.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent f130dd3 commit e2d19ac
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments