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@v11

Inputs

NameRequiredDefaultDescription
repo-tokenNo${{ github.token }}Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.
stale-issue-messageNononeThe message to post on the issue when tagging it. If none provided, will not mark issues stale.
stale-pr-messageNononeThe message to post on the pull request when tagging it. If none provided, will not mark pull requests stale.
close-issue-messageNononeThe message to post on the issue when closing it. If none provided, will not comment when closing an issue.
close-pr-messageNononeThe message to post on the pull request when closing it. If none provided, will not comment when closing a pull requests.
days-before-staleNo60The 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-staleNononeThe 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-staleNononeThe 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-closeNo7The 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-closeNononeThe 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-closeNononeThe 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-labelNoStaleThe label to apply when an issue is stale.
close-issue-labelNononeThe label to apply when an issue is closed.
exempt-issue-labelsNononeThe labels that mean an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2").
close-issue-reasonNonot_plannedThe reason to use when closing an issue.
stale-pr-labelNoStaleThe label to apply when a pull request is stale.
close-pr-labelNononeThe label to apply when a pull request is closed.
exempt-pr-labelsNononeThe labels that mean a pull request is exempt from being marked as stale. Separate multiple labels with commas (eg. "label1,label2").
exempt-milestonesNononeThe 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-milestonesNononeThe 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-milestonesNononeThe 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-milestonesNofalseExempt all issues and pull requests with milestones from being marked as stale. Default to false.
exempt-all-issue-milestonesNononeExempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues.
exempt-all-pr-milestonesNononeExempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests.
only-labelsNononeOnly 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-labelsNononeOnly 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-labelsNononeOnly 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-labelsNononeOnly 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-labelsNononeOnly 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-labelsNononeOnly 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-runNo30The maximum number of operations per run, used to control rate limiting (GitHub API CRUD related).
remove-stale-when-updatedNotrueRemove stale labels from issues and pull requests when they are updated or commented on.
remove-issue-stale-when-updatedNononeRemove 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-updatedNononeRemove stale labels from pull requests when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the pull requests.
debug-onlyNofalseRun the processor in debug mode without actually performing any operations on live issues.
ascendingNofalseThe order to get issues or pull requests. Defaults to false, which is descending.
sort-byNocreatedWhat to sort results by. Valid options are `created`, `updated`, and `comments`. Defaults to `created`.
delete-branchNofalseDelete the git branch after closing a stale pull request.
start-dateNononeThe date used to skip the stale action on issue/pull request created before it (ISO 8601 or RFC 2822).
exempt-assigneesNononeThe assignees which exempt an issue or a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2").
exempt-issue-assigneesNononeThe 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-assigneesNononeThe 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-assigneesNofalseExempt all issues and pull requests with assignees from being marked as stale. Default to false.
exempt-all-issue-assigneesNononeExempt all issues with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the issues.
exempt-all-pr-assigneesNononeExempt all pull requests with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the pull requests.
exempt-draft-prNofalseExempt draft pull requests from being marked as stale. Default to false.
enable-statisticsNotrueDisplay some statistics at the end regarding the stale workflow (only when the logs are enabled).
labels-to-add-when-unstaleNononeA comma delimited list of labels to add when an issue or pull request becomes unstale.
labels-to-remove-when-staleNononeA comma delimited list of labels to remove when an issue or pull request becomes stale.
labels-to-remove-when-unstaleNononeA comma delimited list of labels to remove when an issue or pull request becomes unstale.
ignore-updatesNofalseAny update (update/comment) can reset the stale idle time on the issues and pull requests.
ignore-issue-updatesNononeAny update (update/comment) can reset the stale idle time on the issues. Override "ignore-updates" option regarding only the issues.
ignore-pr-updatesNononeAny update (update/comment) can reset the stale idle time on the pull requests. Override "ignore-updates" option regarding only the pull requests.
include-only-assignedNofalseOnly the issues or the pull requests with an assignee will be marked as stale automatically.
only-issue-typesNononeOnly issues with a matching type are processed as stale/closed. Defaults to `[]` (disabled) and can be a comma-separated list of issue types.

Outputs

NameDescription
closed-issues-prsList of all closed issues and pull requests.
staled-issues-prsList 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.