GitHub Actions actions/stale Closes Nothing or Everything
The actions/stale workflow runs but marks or closes nothing - or sweeps far more than intended. The usual causes are missing write permissions, a debug/dry-run day setting, or mismatched exempt labels.
What this error means
The scheduled stale job completes successfully but no issues or PRs are labeled or closed, or it unexpectedly closes active ones. The logs show it processed zero items or the wrong set.
Warning: Resource not accessible by integration
# stale tried to label an issue without issues: write
# or: days-before-stale: -1 (debug) silently disables stalingCommon causes
Missing issues/pull-requests write permission
actions/stale needs issues: write and pull-requests: write to label and close items. Without them it errors "Resource not accessible by integration" and processes nothing.
Day thresholds or labels misconfigured
A negative days-before-stale is a debug/no-op value, and exempt-issue-labels that do not match your real labels cause stale to skip (or not skip) the wrong items.
How to fix it
Grant the required permissions
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 60
days-before-close: 7Fix thresholds and exempt labels
- Use positive day values; -1 disables that phase (a debug mode), it does not mean "immediately".
- Match exempt-issue-labels / exempt-pr-labels to labels that actually exist.
- Set operations-per-run high enough to cover your backlog, since it is rate-limited per run.
How to prevent it
- Declare issues: write and pull-requests: write for stale workflows.
- Start with a debug run (days-before-close: -1) to preview before enabling close.
- Keep exempt label names in sync with your real labels.