Stale
Marks issues and pull requests that have not had recent interaction
Install / Use
/learn @actions/StaleREADME
Close Stale Issues and PRs
Breaking changes in V10
- Upgraded action from node20 to node 24
Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. Release Notes
For more details, see the full release notes on the release page
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
The configuration must be on the default branch and the default values will:
- Add a label "Stale" on issues and pull requests after 60 days of inactivity and comment on them
- Close the stale issues and pull requests after 7 days of inactivity
- If an update/comment occur on stale issues or pull requests, the stale label will be removed and the timer will restart
Recommended permissions
For the execution of this action, it must be able to fetch all issues and pull requests from your repository.
In addition, based on the provided configuration, the action could require more permission(s) (e.g.: add label, remove label, comment, close, delete branch, etc.).
This can be achieved with the following configuration in the action if the permissions are restricted:
permissions:
actions: write
contents: write # only for delete-branch option
issues: write
pull-requests: write
You can find more information about the required permissions under the corresponding options that you wish to use.
Statefulness
If the action ends because of operations-per-run then the next run will start from the first unprocessed issue skipping the issues processed during the previous run(s). The state is reset when all the issues are processed. This should be considered for scheduling workflow runs.
The saved state lifetime is the same as the actions cache configured for the repo.
All options
List of input options
Every argument is optional.
| Input | Description | Default |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------- |
| repo-token | PAT for GitHub API authentication | ${{ github.token }} |
| days-before-stale | Idle number of days before marking issues/PRs stale | 60 |
| days-before-issue-stale | Override days-before-stale for issues only | |
| days-before-pr-stale | Override days-before-stale for PRs only | |
| days-before-close | Idle number of days before closing stale issues/PRs | 7 |
| days-before-issue-close | Override days-before-close for issues only | |
| days-before-pr-close | Override days-before-close for PRs only | |
| stale-issue-message | Comment on the staled issues | |
| stale-pr-message | Comment on the staled PRs | |
| close-issue-message | Comment on the staled issues while closed | |
| close-pr-message | Comment on the staled PRs while closed | |
| stale-issue-label | Label to apply on staled issues | Stale |
| close-issue-label | Label to apply on closed issues | |
| close-issue-reason | Reason to use when closing issues | not_planned |
| stale-pr-label | Label to apply on staled PRs | Stale |
| close-pr-label | Label to apply on closed PRs | |
| exempt-issue-labels | Labels on issues exempted from stale | |
| exempt-pr-labels | Labels on PRs exempted from stale | |
| only-labels | Only issues/PRs with ALL these labels are checked | |
| only-issue-labels | Override only-labels for issues only | |
| only-pr-labels | Override only-labels for PRs only | |
| any-of-labels | Only issues/PRs with ANY of these labels are checked | |
| any-of-issue-labels | Override any-of-labels for issues only | |
| any-of-pr-labels | Override any-of-labels for PRs only | |
| operations-per-run | Max number of operations per run | 30 |
| remove-stale-when-updated | Remove stale label from issues/PRs on updates | true |
| remove-issue-stale-when-updated | Remove stale label from issues on updates/comments | |
| remove-pr-stale-when-updated | Remove stale label from PRs on updates/comments | |
| labels-to-add-when-unstale | Add specified labels from issues/PRs when they become unstale | |
| labels-to-remove-when-stale | Remove specified labels from issues/PRs when they become stale | |
| labels-to-remove-when-unstale | Remove specified labels from issues/PRs when they become unstale | |
| debug-only | Dry-run | false |
| ascending | Order to get issues/PRs | false |
| start-date | Skip stale action for issues/PRs created before it | |
| delete-branch | Delete branch after closing a stale PR | false |
| exempt-milestones | Milestones on issues/PRs exempted from stale | |
| exempt-issue-milestones | Override exempt-milestones for issues only | |
| exempt-pr-milestones | Override exempt-milestones for PRs only | |
| exempt-all-milestones | Exempt all issues/PRs with milestones from stale | false |
| exempt-all-issue-milestones | Override exempt-all-milestones for issues only | |
| exempt-all-pr-milestones | Override [exempt-all-milestones](#exemp
