actions/stale
Automatically mark and close stale issues and pull requests.
What it does
actions/stale runs on a schedule, adds a stale label and comment to issues/PRs with no recent activity, and closes them if they stay inactive.
It has a per-run operations budget so a large backlog is processed over several runs.
Usage
workflow (.yml)
on:
schedule:
- cron: '0 1 * * *'
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: 7Inputs
| Input | Description | Default | Required |
|---|---|---|---|
days-before-stale | Days of inactivity before marking stale. | 60 | No |
days-before-close | Days after stale before closing. | 7 | No |
stale-issue-label | Label applied when stale. | Stale | No |
exempt-issue-labels | Labels that exempt an issue. | - | No |
operations-per-run | API operation budget per run. | 30 | No |
Notes
Runs best on a schedule. Needs issues: write and pull-requests: write.
Common errors
- Only a few items processed per run is expected; raise
operations-per-runor let it catch up over days.
Security and pinning
- Grant only
issues/pull-requestswrite. Pin the action SHA.
Alternatives and related
Frequently asked questions
Why does stale only touch a few issues per run?
It has an
operations-per-run budget (default 30) to stay within API limits. It processes the rest on subsequent scheduled runs.