Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches: [main]
tags: ['v*']

permissions:
contents: read
pull-requests: read
Comment on lines +9 to +11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Security & Privacy · Quick win

Remove pull-requests: read from the workflow permissions.

No job in this workflow needs pull request access. The four checkout jobs need only contents: read. The tj-actions/changed-files step in check-changelog runs after actions/checkout, so it uses the local Git path. It calls the pull request REST API only when use_rest_api is true, and this workflow does not set that input. The other jobs make no GitHub API calls.

The workflow-level grant gives every step in the four checkout jobs a token that can read pull request data. These jobs run checked-out code and dependency install scripts, and they do not use that access. ci-pass already sets permissions: {}, so this change does not affect it.

Suggested fix
--- "a/.github/workflows/ci.yml"
+++ "b/.github/workflows/ci.yml"
@@ -6,9 +6,8 @@
     branches: [main]
     tags: ['v*']
 
 permissions:
   contents: read
-  pull-requests: read
 
 jobs:
   check-changelog:
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
pull-requests: read
permissions:
contents: read


jobs:
check-changelog:
Expand Down Expand Up @@ -135,6 +138,7 @@ jobs:
# The only check the ruleset requires, so jobs can change without touching repo settings.
ci-pass:
if: always()
permissions: {}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
needs:
- check-changelog
- frontend
Expand Down
1 change: 1 addition & 0 deletions changelog/164.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gave the `ci-pass` CI job no token permissions.
Loading