Add a permissions block to ci.yml so the default token can drop to read - #605
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 thepreviewjob in.github/workflows/ci.yml. - Grant
contents: readandpull-requests: writeat the job level (intended to avoid relying on repo-level default token permissions).
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-levelwritedefault; this gives it the same job-level blocklecture-jax/ci.ymlalready carries (contents: read+pull-requests: write). The publish, linkcheck and sync workflows already carry explicit blocks, andcache.yml/execution-*.ymlwrite nothing withGITHUB_TOKEN.Once a job carries a
permissions:block, unlisted scopes drop tononeregardless 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