Skip to content

ci: declare least-privilege GITHUB_TOKEN scope on server and www - #30

Open
z33b0t wants to merge 1 commit into
mainfrom
ci/workflow-permissions
Open

ci: declare least-privilege GITHUB_TOKEN scope on server and www#30
z33b0t wants to merge 1 commit into
mainfrom
ci/workflow-permissions

Conversation

@z33b0t

@z33b0t z33b0t commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

server.yml and www.yml declared no permissions: block, so GITHUB_TOKEN was issued with the repository default scope. Both only check out — the www deploy authenticates to Cloudflare with its own API token — so contents: read is the whole requirement.

This clears CodeQL actions/missing-workflow-permissions alert #1 and alert #2.

One correction to the issue: it says none of the four workflows declare a block. mac.yml:31 and windows.yml:31 already declare contents: write at job level (which is narrower than a top-level block, since it doesn't extend to any job added later). They're left as they are, so this PR is the remaining half.

Closes #15

Neither workflow declared a `permissions:` block, so GITHUB_TOKEN was issued
with the repository default scope. Both only ever check out — the www deploy
authenticates to Cloudflare with its own API token — so `contents: read` is
what they need, and stating it means a later change to the repository default
can't silently widen them.

mac.yml and windows.yml already declare `contents: write` at job level for
`gh release create` / `upload`, so they are left alone.

Clears CodeQL actions/missing-workflow-permissions alerts #1 and #2.

Closes #15
@z33b0t

z33b0t commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@z33b0t ready to merge.

All 9 checks green: CodeQL Analyze across actions/csharp/javascript-typescript/python/swift, plus the protocol suite on Python 3.11/3.12/3.13 (this PR touches .github/workflows/server.yml, which is inside that workflow's own path filter, so the suite did run).

The CodeQL actions analysis passing is the relevant signal here — it's what raised alerts #1 and #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflows do not declare least-privilege GITHUB_TOKEN permissions

1 participant