Skip to content

ci: check jobs hold contents read unless they ask for more - #671

Merged
Vivswan merged 1 commit into
mainfrom
ci/checks-default-read
Nov 23, 2026
Merged

Vivswan merged 1 commit into
mainfrom
ci/checks-default-read

Conversation

@Vivswan

@Vivswan Vivswan commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What this specifies

# .github/workflows/checks.yml, added at the top level
permissions:
  contents: read
before:  a check job with no permissions block  ->  inherits the caller's whole grant
after:   a check job with no permissions block  ->  contents: read

How

  • Why now: the managed ci.yml now grants the checks call contents: write, and a job with no permissions: of its own inherits it.
  • Effect: every check job holds contents: read, as before the grant changed; a job that needs more declares it.
  • Nothing else changes.

Proof

  • This pull request's own run is the check: it runs every check job under the new block.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 08:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the change restricting the reusable checks workflow’s default token permissions to read-only repository contents access.

No open issues 🎉

What changed in this PR

This PR limits the default GITHUB_TOKEN permissions for the reusable checks workflow without changing its jobs or steps.

Changes:

  • Adds workflow-level permissions: contents: read for jobs without explicit permission overrides.
  • Jobs needing additional permissions must request them explicitly, within the caller's allowed grant.
File Description
.github/​workflows/​checks.yml Sets the default token permissions to repository contents read access.

Review effort: Balanced

@Vivswan
Vivswan marked this pull request as ready for review November 23, 2026 09:43
@Vivswan
Vivswan merged commit 49f07ed into main Nov 23, 2026
32 checks passed
@Vivswan
Vivswan deleted the ci/checks-default-read branch November 23, 2026 09:43
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.

2 participants