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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 13 days ago
In general, this issue is fixed by explicitly declaring a
permissionsblock in the workflow (either at the root or per‑job) that grants only the minimal scopes the workflow needs. This overrides potentially broad repository defaults and documents the workflow’s required privileges.For this specific workflow, we should add a root‑level
permissionsblock between thenameandonkeys, because there is only one job and it delegates to a reusable workflow. A safe, minimal starting point that aligns with GitHub’s guidance iscontents: read, which is equivalent to read‑only repository access. If the reusable workflow requires additional scopes (for example, to approve or update pull requests), those would typically bepull-requests: write. However, we are not allowed to assume additional behavior beyond the snippet, so we will start with the minimal explicit restriction:permissions: contents: read. This keeps existing behavior in nearly all cases where the reusable workflow only needs read access, while constraining the token compared to legacy defaults. The change is localized to.github/workflows/renovate-approve.yml, and no new imports or methods are required.Concretely:
.github/workflows/renovate-approve.yml.permissions:block after line 1 (thename:line) and before theon:block.contents: readin that block.No other lines in the file need to change.