actions/stale@v11
Close issues and pull requests with no recent activity
At a glance
- Latest major
v11- Repository
- actions/stale
- Inputs
- 55 (0 required)
- Outputs
- 2
- Runs using
node24- License
- MIT
- Last checked
Inputs and outputs come straight from the action's official action.yml. See our editorial standards.
Usage
- uses: actions/stale@v11Inputs
| Name | Required | Default | Description |
|---|---|---|---|
repo-token | No | ${{ github.token }} | Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. |
stale-issue-message | No | none | The message to post on the issue when tagging it. If none provided, will not mark issues stale. |
stale-pr-message | No | none | The message to post on the pull request when tagging it. If none provided, will not mark pull requests stale. |
close-issue-message | No | none | The message to post on the issue when closing it. If none provided, will not comment when closing an issue. |
close-pr-message | No | none | The message to post on the pull request when closing it. If none provided, will not comment when closing a pull requests. |
days-before-stale | No | 60 | The number of days old an issue or a pull request can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically. |
days-before-issue-stale | No | none | The number of days old an issue can be before marking it stale. Set to -1 to never mark issues as stale automatically. Override "days-before-stale" option regarding only the issues. |
days-before-pr-stale | No | none | The number of days old a pull request can be before marking it stale. Set to -1 to never mark pull requests as stale automatically. Override "days-before-stale" option regarding only the pull requests. |
days-before-close | No | 7 | The number of days to wait to close an issue or a pull request after it being marked stale. Set to -1 to never close stale issues or pull requests. |
days-before-issue-close | No | none | The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues. Override "days-before-close" option regarding only the issues. |
days-before-pr-close | No | none | The number of days to wait to close a pull request after it being marked stale. Set to -1 to never close stale pull requests. Override "days-before-close" option regarding only the pull requests. |
stale-issue-label | No | Stale | The label to apply when an issue is stale. |
close-issue-label | No | none | The label to apply when an issue is closed. |
exempt-issue-labels | No | none | The labels that mean an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2"). |
close-issue-reason | No | not_planned | The reason to use when closing an issue. |
stale-pr-label | No | Stale | The label to apply when a pull request is stale. |
close-pr-label | No | none | The label to apply when a pull request is closed. |
exempt-pr-labels | No | none | The labels that mean a pull request is exempt from being marked as stale. Separate multiple labels with commas (eg. "label1,label2"). |
exempt-milestones | No | none | The milestones that mean an issue or a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). |
exempt-issue-milestones | No | none | The milestones that mean an issue is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the issues. |
exempt-pr-milestones | No | none | The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests. |
exempt-all-milestones | No | false | Exempt all issues and pull requests with milestones from being marked as stale. Default to false. |
exempt-all-issue-milestones | No | none | Exempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues. |
exempt-all-pr-milestones | No | none | Exempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests. |
only-labels | No | none | Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. |
any-of-labels | No | none | Only issues or pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. |
any-of-issue-labels | No | none | Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the issues. |
any-of-pr-labels | No | none | Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the pull requests. |
only-issue-labels | No | none | Only issues with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the issues. |
only-pr-labels | No | none | Only pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the pull requests. |
operations-per-run | No | 30 | The maximum number of operations per run, used to control rate limiting (GitHub API CRUD related). |
remove-stale-when-updated | No | true | Remove stale labels from issues and pull requests when they are updated or commented on. |
remove-issue-stale-when-updated | No | none | Remove stale labels from issues when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the issues. |
remove-pr-stale-when-updated | No | none | Remove stale labels from pull requests when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the pull requests. |
debug-only | No | false | Run the processor in debug mode without actually performing any operations on live issues. |
ascending | No | false | The order to get issues or pull requests. Defaults to false, which is descending. |
sort-by | No | created | What to sort results by. Valid options are `created`, `updated`, and `comments`. Defaults to `created`. |
delete-branch | No | false | Delete the git branch after closing a stale pull request. |
start-date | No | none | The date used to skip the stale action on issue/pull request created before it (ISO 8601 or RFC 2822). |
exempt-assignees | No | none | The assignees which exempt an issue or a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). |
exempt-issue-assignees | No | none | The assignees which exempt an issue from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the issues. |
exempt-pr-assignees | No | none | The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the pull requests. |
exempt-all-assignees | No | false | Exempt all issues and pull requests with assignees from being marked as stale. Default to false. |
exempt-all-issue-assignees | No | none | Exempt all issues with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the issues. |
exempt-all-pr-assignees | No | none | Exempt all pull requests with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the pull requests. |
exempt-draft-pr | No | false | Exempt draft pull requests from being marked as stale. Default to false. |
enable-statistics | No | true | Display some statistics at the end regarding the stale workflow (only when the logs are enabled). |
labels-to-add-when-unstale | No | none | A comma delimited list of labels to add when an issue or pull request becomes unstale. |
labels-to-remove-when-stale | No | none | A comma delimited list of labels to remove when an issue or pull request becomes stale. |
labels-to-remove-when-unstale | No | none | A comma delimited list of labels to remove when an issue or pull request becomes unstale. |
ignore-updates | No | false | Any update (update/comment) can reset the stale idle time on the issues and pull requests. |
ignore-issue-updates | No | none | Any update (update/comment) can reset the stale idle time on the issues. Override "ignore-updates" option regarding only the issues. |
ignore-pr-updates | No | none | Any update (update/comment) can reset the stale idle time on the pull requests. Override "ignore-updates" option regarding only the pull requests. |
include-only-assigned | No | false | Only the issues or the pull requests with an assignee will be marked as stale automatically. |
only-issue-types | No | none | Only issues with a matching type are processed as stale/closed. Defaults to `[]` (disabled) and can be a comma-separated list of issue types. |
Outputs
| Name | Description |
|---|---|
closed-issues-prs | List of all closed issues and pull requests. |
staled-issues-prs | List of all staled issues and pull requests. |
Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.
Examples
Close inactive issues
Label stale issues after 60 days and close them 14 days later.
name: Example
on:
schedule:
- cron: "17 3 * * *"
permissions:
issues: write
pull-requests: write
jobs:
example:
runs-on: ubuntu-latest
steps:
- name: Close Stale Issues
uses: actions/stale@v11
with:
days-before-stale: 60
days-before-close: 14
stale-issue-label: stale
stale-issue-message: This issue has had no activity for 60 days and will be closed soon.
repo-token: ${{ secrets.GITHUB_TOKEN }}Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.
Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.