Conversation
Calls the centralised reusable workflow in reqstool/.github to auto-approve Renovate PRs, satisfying the required-review branch protection rule and unblocking Renovate's auto-merge. Signed-off-by: jimisola <jimisola@jimisola.com>
|
|
||
| jobs: | ||
| approve: | ||
| uses: reqstool/.github/.github/workflows/renovate-approve.yml@main |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 days ago
In general, the fix is to explicitly define a permissions: block either at the workflow root (applies to all jobs) or inside the specific job. Since this workflow only defines a single job (approve) that simply calls a reusable workflow, the cleanest approach is to add a root-level permissions: section that grants only read access to repository contents, which is usually sufficient for Renovate approval logic driven by another workflow. If the reusable workflow needs additional scopes, they can be added there; here we keep the caller minimal.
Concretely, in .github/workflows/renovate-approve.yml, insert a permissions: block after the name: line and before on:. Use a minimal least-privilege setting such as:
permissions:
contents: readThis ensures the GITHUB_TOKEN used by this workflow is explicitly limited and no longer depends on potentially broad repository defaults. No imports or additional methods are needed; only the YAML structure changes.
| @@ -1,5 +1,8 @@ | ||
| name: Renovate auto-approve | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: |
Summary
🤖 Generated with Claude Code