ci: per-job permissions for publish-pypi, release-doctor, sync-labels, semgrep#2726
Merged
Conversation
…, semgrep - publish-pypi: contents: read -- publish step uses PYPI_TOKEN, not GITHUB_TOKEN. - release-doctor: contents: read -- only runs a local sanity-check script. - sync-labels: issues: write -- micnncim/action-label-syncer manages repo labels via GITHUB_TOKEN. - semgrep: contents: read -- only checks out code and runs semgrep ci. Matches the per-job permissions style already used in ci.yml and detect-breaking-changes.yml. Co-authored-by: arpitjain099 <arpitjain099@gmail.com>
756ac96 to
ed104a9
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.
Per-job
permissionsblocks on the four workflows still inheriting defaults:contents: read. The actual PyPI publish usesPYPI_TOKEN(or its Cloudflare-specific override), not the GitHub token. The runner only needs to check out the source.contents: read. Just runs./bin/check-release-environmentas a sanity check.issues: write.micnncim/action-label-syncer@v1creates/updates labels viaGITHUB_TOKEN; that endpoint is part of the issues API, soissues: writeis the documented minimum.contents: read. Only checks out code and runssemgrep ciwith an app token.Per-job style matches
ci.yml(contents: read+id-token: write) anddetect-breaking-changes.yml(contents: read).Supersedes #2720 (rebased onto
next, added semgrep permissions).