fix: add actions:write permission to stale workflow#2079
Merged
mnriem merged 1 commit intogithub:mainfrom Apr 3, 2026
Merged
Conversation
The actions/stale@v10 action uses GitHub Actions cache to persist state across runs. Without the actions:write permission, the action can write cache entries but cannot delete them (403 error on cache cleanup). This causes a vicious cycle: once an issue is processed and cached, the action skips it on every future run with 'issue skipped due being processed during the previous run' - so stale issues never reach the closing logic after being marked stale. Adding actions:write allows the action to properly manage its cache lifecycle, enabling stale issues to be closed after the configured 30-day close window.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the repository’s stale-issues workflow so it can successfully close issues/PRs after the configured close window by granting the workflow permission to manage the GitHub Actions cache state used by actions/stale@v10.
Changes:
- Add
actions: writeto thepermissionsblock in the stale workflow so the action can delete/cleanup its cache entries and avoid permanently skipping previously processed issues.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The stale workflow marks issues as stale after 150 days but never closes them after the 30-day close window.
Root Cause
actions/stale@v10uses the GitHub Actions cache to persist state across runs. The workflow only hasissues: writeandpull-requests: writepermissions — it's missingactions: write.Without that permission, the action can write cache entries but cannot delete them (returns a 403 on cache cleanup):
This creates a vicious cycle: once an issue is processed and cached, the action skips it on every future run:
So stale issues never reach the closing logic.
Fix
Add
actions: writeto the workflow permissions block, allowing the stale action to properly manage its cache lifecycle.Post-Merge
After merging, you may want to clear the existing stale action cache so all issues get reprocessed on the next run: