Move write permissions to job-level in workflows#1444
Merged
Conversation
Scorecard Token-Permissions check requires that write permissions are scoped to individual jobs, not at the workflow top-level. Affected workflows: - release.yaml: add top-level permissions: read-all - release-drafter.yaml: move contents:write to job level - codeql.yaml: move security-events:write to job level - labels.yaml: move issues:write to job level - lock.yaml: move issues/pull-requests:write to job level - stale.yaml: move issues/pull-requests:write to job level - auto-approve-renovate.yml: move pull-requests:write to job level
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 6 6
Lines 955 955
Branches 128 128
=======================================
Hits 954 954
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates GitHub Actions workflow GITHUB_TOKEN permissions to satisfy Scorecard’s Token-Permissions check by setting workflow-level defaults to read-only and moving write scopes to the specific jobs that need them.
Changes:
- Set workflow-level
permissions: read-allacross the affected workflows. - Move write permissions (e.g.,
issues: write,pull-requests: write,security-events: write,contents: write) to the corresponding job-levelpermissionsblocks. - Keep existing job-level write requirements (e.g., release upload/signing) intact while making the workflow defaults read-only.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/stale.yaml | Sets workflow default to read-all; grants issues/PR write at the stale job level. |
| .github/workflows/release.yaml | Adds workflow default read-all; keeps job-level contents: write and id-token: write for publishing and release uploads. |
| .github/workflows/release-drafter.yaml | Sets workflow default read-all; scopes contents: write to the release-drafter job. |
| .github/workflows/lock.yaml | Sets workflow default read-all; grants issues/PR write at the lock job level. |
| .github/workflows/labels.yaml | Sets workflow default read-all; scopes contents: read + issues: write to the labels sync job. |
| .github/workflows/codeql.yaml | Sets workflow default read-all; scopes security-events: write to the CodeQL job. |
| .github/workflows/auto-approve-renovate.yml | Sets workflow default read-all; scopes pull-requests: write to the auto-approve job. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Scorecard Token-Permissions check requires that write permissions are scoped to individual jobs, not at the workflow top-level.
Affected workflows: