Skip to content

Add a permissions block to ci.yml so the default token can drop to read - #605

Merged
mmcky merged 2 commits into
mainfrom
token-permissions-meta-347
Aug 5, 2026
Merged

Add a permissions block to ci.yml so the default token can drop to read#605
mmcky merged 2 commits into
mainfrom
token-permissions-meta-347

Conversation

@mmcky

@mmcky mmcky commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preparation for QuantEcon/meta#347 item 4 (default workflow token permissions → read). ci.yml's Netlify preview step is the one workflow here that relies on the repo-level write default; this gives it the same job-level block lecture-jax/ci.yml already carries (contents: read + pull-requests: write). The publish, linkcheck and sync workflows already carry explicit blocks, and cache.yml/execution-*.yml write nothing with GITHUB_TOKEN.

Once a job carries a permissions: block, unlisted scopes drop to none regardless of the repo default — so this merges safely before or after the settings flip, and it is what makes the flip safe to do.

🤖 Generated with Claude Code

The Netlify preview step is the one consumer of the default token's
write access here; contents:read + pull-requests:write is the same
block lecture-jax/ci.yml already carries. The other workflows either
have blocks or write nothing with GITHUB_TOKEN.

Part of QuantEcon/meta#347 item 4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prepares the repository for a future change that sets the default GITHUB_TOKEN permissions to read-only by adding an explicit job-level permissions block to the ci.yml pull request workflow (notably for the Netlify preview step).

Changes:

  • Add an explicit permissions: block to the preview job in .github/workflows/ci.yml.
  • Grant contents: read and pull-requests: write at the job level (intended to avoid relying on repo-level default token permissions).

Comment thread .github/workflows/ci.yml
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Public-repo API leniency is what lets dawidd6/action-download-artifact
work without the scope today; the grant matches the documented
requirement and the comment publish.yml already carries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-stats that referenced this pull request Aug 5, 2026
Public-repo API leniency is what lets dawidd6/action-download-artifact
work without the scope today; the grant matches the documented
requirement and the comment publish.yml carries in the sibling repos.
Raised by Copilot on QuantEcon/lecture-python-programming#605.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmcky
mmcky merged commit 6ee9cdb into main Aug 5, 2026
4 checks passed
@mmcky
mmcky deleted the token-permissions-meta-347 branch August 5, 2026 03:15
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