ci: declare permissions on lint, test, pr-comment, release#135
Open
arpitjain099 wants to merge 1 commit into
Open
ci: declare permissions on lint, test, pr-comment, release#135arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
Author
|
I have read the CLA Document and I hereby sign the CLA |
fdbd509 to
5920ee4
Compare
Author
|
Hi @ravindra-cloudflare, gentle ping on this. PR has been open for 4 days without review. I noticed you've been on the recent-merger side of recent merges in this repo. When you have a moment, would you mind giving it a quick look? No urgency. Happy to address any feedback. |
Collaborator
|
We are working on setting up trusted published and staged releases. We are parking this PR till then. It will be picked and merged after that. |
Author
|
Thanks @ravindra-cloudflare, appreciate the heads up - no rush on my side, happy to wait until the trusted publishing work lands. |
lint.yml and test.yml are read-only and only need contents: read. pr-comment.yml runs `gh pr comment` against the PR, so it gets contents: read + pull-requests: write. release.yml runs semantic-release (creates GH releases, tags, comments on issues/PRs about the release) and pushes main onto staging, so it needs contents: write + issues: write + pull-requests: write. The npm publish step uses NPM_PUBLISH_TOKEN, not GITHUB_TOKEN. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
b9a3d22 to
94a1b20
Compare
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.
Adds explicit top-level
permissions:to the four workflows still relying on default token scopes:contents: read. Pure CI — install deps, lint/build, run tests.contents: read+pull-requests: write. The step runsgh pr comment$PR_NUMBER --body ...withGITHUB_TOKEN;pull-requests: writeis the documented scope for the comments API.contents: write+issues: write+pull-requests: write.npx semantic-releasecreates the GitHub release/tag and posts the released-issue/PR comments. The finalgit push --set-upstream origin stagingstep also needscontents: write. The npm publish step usesNPM_PUBLISH_TOKEN, not the GitHub token.Already-hardened siblings (
ai-pr-review.yml,bonk.yml,update-docs.yml) follow the same top-level approach. YAML validated withyaml.safe_load.