Skip to content

Give every workflow a top-level contents: read permission - #92

Merged
imanimanyara merged 1 commit into
mainfrom
ci/least-privilege-permissions
Nov 4, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
ci/least-privilege-permissions

Conversation

@imanimanyara

Copy link
Copy Markdown
Contributor

Summary

Closes S9: workflows with no top-level permissions: block. The organisation default is read-only, but an explicit block means a change to that setting cannot widen these tokens.

  • .github/workflows/code-quality.yml: contents: read (top level). Read-only jobs: checkout, install, lint, tests; nothing writes.
  • .github/workflows/tests.yml: contents: read (top level). Read-only jobs: checkout, install, lint, tests; nothing writes.

No job needed a write grant, so none was added at job level. tests/WorkflowPermissionsTest.php fails if any workflow in this repository lacks a top-level permissions: (checked red by removing one block). CHANGELOG [Unreleased] Security updated.

Closes S9. None of these jobs writes, so contents: read is the whole grant. A test fails if a workflow loses the block.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 20:37

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@imanimanyara
imanimanyara merged commit 2376811 into main Nov 4, 2026
10 checks passed
@imanimanyara
imanimanyara deleted the ci/least-privilege-permissions branch November 6, 2026 00:25
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