Skip to content

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

Merged
z33b0t merged 1 commit into
mainfrom
ci/workflow-permissions
Jul 29, 2026
Merged

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

Conversation

@z33b0t

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-permissionsalert #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

Copy link
Copy Markdown
ContributorAuthor

@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.

@z33b0t
z33b0t merged commit 5bf264a into mainJul 29, 2026
9 checks passed
@z33b0t
z33b0t deleted the ci/workflow-permissions branch July 29, 2026 16:45
Sign up for freeto 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

@z33b0t