MCPcopy Index your code
hub / github.com/actions/stale

github.com/actions/stale @v10.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v10.3.0 ↗ · + Follow
360 symbols 903 edges 82 files 2 documented · 1% updated 8d agov10.3.0 · 2026-05-21★ 1,68457 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Close Stale Issues and PRs

Basic validation e2e tests

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 for PRs only
exempt-assignees Assignees on issues/PRs exempted from stale
exempt-issue-assignees Override exempt-assignees for issues only
exempt-pr-assignees Override exempt-assignees for PRs only
exempt-all-assignees Exempt all issues/PRs with assignees from stale false
exempt-all-issue-assignees Override exempt-all-assignees for issues only
exempt-all-pr-assignees Override exempt-all-assignees for PRs only
exempt-draft-pr Skip the stale action for draft PRs false
enable-statistics Display statistics in the logs true
ignore-updates Any update (update/comment) can reset the stale idle time on the issues/PRs false
ignore-issue-updates Override ignore-updates for issues only
ignore-pr-updates Override ignore-updates for PRs only
include-only-assigned Process only assigned issues false
sort-by What to sort issues and PRs by created
only-issue-types Only issues with a matching type are processed as stale/closed.

List of output options

Output Description
staled-issues-prs List of all staled issues and pull requests
closed-issues-prs List of all closed issues and pull requests

Detailed options

repo-token

Personal Access Token (PAT) that allows the stale workflow to authenticate and perform API calls to GitHub.
Under the hood, it uses the @actions/github package.

Default value: ${{ github.token }}

days-before-stale

The idle number of days before marking the issues or the pull requests as stale (by adding a label).
The issues or the pull requests will be marked as stale if the last update (based on GitHub issue field updated_at) is older than the idle number of days.
It means that any updates made, or any comments added to the issues or to the pull requests will restart the counter of days before marking as stale.
However, if you wish to ignore this behaviour so that the creation date (based on GitHub issue field created_at) only matters, you can disable the ignore-updates option.

If set to a negative number like -1, no issues or pull requests will be marked as stale automatically.
In that case, you can still add the stale label manually to mark as

Extension points exported contracts — how you extend this code

IState (Interface)
(no doc) [4 implementers]
src/interfaces/state/state.ts
IGroupValue (Interface)
(no doc)
src/classes/statistics.ts
ITestData (Interface)
(no doc)
__tests__/milestones.spec.ts
ITestData (Interface)
(no doc)
__tests__/assignees.spec.ts
IStateStorage (Interface)
(no doc) [2 implementers]
src/interfaces/state/state-storage.ts
IHasRemainingOperationsMatrix (Interface)
(no doc)
src/classes/stale-operations.spec.ts
IIssue (Interface)
(no doc) [1 implementers]
src/interfaces/issue.ts
IGetRemainingOperationsCountMatrix (Interface)
(no doc)
src/classes/stale-operations.spec.ts

Core symbols most depended-on inside this repo

processIssues
called by 323
src/classes/issues-processor.ts
info
called by 69
src/classes/loggers/issue-logger.ts
info
called by 67
src/classes/loggers/logger.ts
createOptionLink
called by 48
src/classes/loggers/logger.ts
white
called by 48
src/services/logger.service.ts
cyan
called by 46
src/services/logger.service.ts
shouldExemptMilestones
called by 39
src/classes/milestones.ts
shouldExemptAssignees
called by 39
src/classes/assignees.ts

Shape

Method 252
Class 52
Function 36
Interface 18
Enum 2

Languages

TypeScript100%

Modules by API surface

src/classes/statistics.ts55 symbols
src/classes/issues-processor.ts37 symbols
__tests__/updates-reset-stale.spec.ts19 symbols
__tests__/remove-stale-when-updated.spec.ts16 symbols
src/classes/loggers/issue-logger.ts15 symbols
src/classes/milestones.ts14 symbols
src/classes/assignees.ts14 symbols
src/services/logger.service.ts13 symbols
__tests__/operations-per-run.spec.ts13 symbols
src/classes/state/state.ts12 symbols
__tests__/only-labels.spec.ts12 symbols
__tests__/any-of-labels.spec.ts12 symbols

For agents

$ claude mcp add stale \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page