Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/renovate-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Renovate auto-approve

on:
pull_request:
types:
- opened
- reopened

jobs:
approve:
uses: reqstool/.github/.github/workflows/renovate-approve.yml@main

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 14 days ago

To fix the issue, add an explicit permissions block that grants the least privileges needed for this workflow. Since this workflow simply triggers a reusable workflow on pull_request events and does not itself perform any repository modifications, a safe and minimal default is to restrict GITHUB_TOKEN to read-only access to repository contents.

The best targeted fix without changing existing functionality is to add a top-level permissions: section (applies to all jobs) or a job-level permissions: under jobs.approve. Both satisfy CodeQL; using a top-level block is clearer and future-proof if additional jobs are added. We’ll add:

permissions:
  contents: read

between the on: block and the jobs: block in .github/workflows/renovate-approve.yml. This documents that the workflow only needs read access to repository contents and ensures the token is not granted unnecessary write privileges. No imports or additional definitions are required.

Suggested changeset 1
.github/workflows/renovate-approve.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/renovate-approve.yml b/.github/workflows/renovate-approve.yml
--- a/.github/workflows/renovate-approve.yml
+++ b/.github/workflows/renovate-approve.yml
@@ -6,6 +6,9 @@
       - opened
       - reopened
 
+permissions:
+  contents: read
+
 jobs:
   approve:
     uses: reqstool/.github/.github/workflows/renovate-approve.yml@main
EOF
@@ -6,6 +6,9 @@
- opened
- reopened

permissions:
contents: read

jobs:
approve:
uses: reqstool/.github/.github/workflows/renovate-approve.yml@main
Copilot is powered by AI and may make mistakes. Always verify output.