Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10
with:
operations-per-run: 200
delete-branch: true
Comment on lines 10 to 16
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The stale workflow enables delete-branch: true but lacks the necessary permissions: contents: write, which will cause branch deletion to fail under modern repository security settings.
Severity: MEDIUM

Suggested Fix

Add a permissions: block to the job in .github/workflows/stale.yml to explicitly grant contents: write permission, ensuring the action can delete branches as intended.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/stale.yml#L10-L16

Potential issue: The `stale.yml` workflow uses `actions/stale@v10` with the
`delete-branch: true` option. This option requires `contents: write` permission, but the
workflow file does not define a `permissions:` block to grant it. If the repository's
default workflow permissions are set to be restrictive (read-only), the action will
silently fail to delete branches when closing stale pull requests. This will cause
unused branches to accumulate in the repository, even though the rest of the action
(like closing the PR) will succeed.

Did we get this right? 👍 / 👎 to inform future reviews.

Expand Down