A GitHub action to stale and close automatically your issues and pull requests.
Community:
To have in-depth documentation and examples, see the documentation website.
The documentation website is also available as a GitHub page, but we deprecated it.
After 30 days (coming from issue-days-before-stale) without any update on the issue, add a label stale
(coming from issue-stale-label) on the issue to indicate that it is stale.
If an update occur after being stale, the stale
label will be removed and the count will be reset back to 30 days.
Removing the stale
label manually will also do the trick.
If the stale
label on the issue is still here for more than 10 days (coming from issue-days-before-close), the issue will be closed.
After 30 days (coming from pull-request-days-before-stale) without any update on the pull request, add a label stale
(coming from pull-request-stale-label) on the pull request to indicate that it is stale.
If an update occur after being stale, the stale
label will be removed and the count will be reset back to 30 days.
Removing the stale
label manually will also do the trick.
If the stale
label on the pull request is still here for more than 10 days (coming from pull-request-days-before-close), the pull request will be closed.
All the inputs that are used both for issues and pull requests.
Input | Description | Default |
---|---|---|
github-token | A GitHub token used to perform the API calls to GitHub through @actions/github . Usually ${{ secrets.GITHUB_TOKEN }} . |
${{ github.token }} |
dry-run | A mode where any Data Manipulation Language will be skipped. Useful to debug safely and without risking messing up with your repository. | false |
Input | Description | Default |
---|---|---|
Labels | ||
issue-stale-label | The label that will be added to the issue when it is stale. | stale |
issue-ignore-all-labels | Allow to ignore the processing of issues that contains any labels. | false |
issue-ignore-any-labels | Allow to ignore the processing of issues that contains one of those labels (multiline). | |
Assignees | ||
issue-ignore-all-assignees | Allow to ignore the processing of issues that contains any assignees. | false |
issue-ignore-any-assignees | Allow to ignore the processing of issues that contains one of those assignees (multiline). | |
issue-only-with-assignees | Only allow the processing of issues that contains at least one assignee. | false |
issue-only-any-assignees | Only allow the processing of issues that contains one of those assignees (multiline). | |
Project cards | ||
issue-ignore-all-project-cards | Allow to ignore the processing of issues that contains any project cards. | false |
issue-ignore-any-project-cards | Allow to ignore the processing of issues that contains one of those project cards (multiline). | |
issue-only-with-project-cards | Only allow the processing of issues that contains at least one project card. | false |
issue-only-any-project-cards | Only allow the processing of issues that contains one of those project cards (multiline). | |
Milestones | ||
issue-ignore-all-milestones | Allow to ignore the processing of issues that contains any milestones. | false |
issue-ignore-any-milestones | Allow to ignore the processing of issues that contains one of those milestones (multiline). | |
issue-only-with-milestones | Only allow the processing of issues that contains at least one milestone. | false |
issue-only-any-milestones | Only allow the processing of issues that contains one of those milestones (multiline). | |
Comments | ||
issue-stale-comment | The comment that will be sent once the issue is stale (keep empty to not send a comment). | |
issue-close-comment | The comment that will be sent once the issue is close (keep empty to not send a comment). | |
Durations | ||
issue-days-before-stale | The number of days until the issue is considered as stale. | 30 |
issue-days-before-close | The number of days until a stale issue is considered as closed. | 10 |
Limiters | ||
issue-limit-api-queries-count | Limit the quantity of API queries calls performed during the processing of issues (-1 for unlimited). |
-1 |
issue-limit-api-mutations-count | Limit the quantity of API mutations calls performed during the processing of issues (-1 for unlimited). |
-1 |
issue-ignore-before-creation-date | Allow to ignore the processing of issues that were created before this date (ISO 8601). | |
Others | ||
issue-processing | Allow to process the issues. | true |
issue-close-reason | The reason when closing an issue (completed or not planned ). |
not planned |
issue-add-labels-after-stale | A list of labels added when the processing stale the issue (multiline). | |
issue-remove-labels-after-stale | A list of labels removed when the processing stale the issue (multiline). | |
issue-add-labels-after-close | A list of labels added when the processing close the issue (multiline). | |
issue-remove-labels-after-close | A list of labels removed when the processing close the issue (multiline). |
Output | Description |
---|---|
processed-issues-count | The number of issues processed. |
ignored-issues-count | The number of issues ignored. |
unaltered-issues-count | The number of issues unaltered (either not good to stale or already stale). |
stale-issues-count | The number of issues stale. |
already-stale-issues-count | The number of issues processed which were already stale. |
remove-stale-issues-count | The number of issues from where the stale state was removed. |
close-issues-count | The number of issues closed. |
added-issues-comments-count | The number of added issues comments. |
issues-labels-count | The number of mutated issues labels (added or removed). |
added-issues-labels-count | The number of added issues labels. |
removed-issues-labels-count | The number of removed issues labels. |
called-api-issues-count | The number of GitHub API calls performed for the issues. |
called-api-issues-queries-count | The number of GitHub API queries calls performed for the issues. |
called-api-issues-mutations-count | The number of GitHub API mutations calls performed for the issues. |
Input | Description | Default |
---|---|---|
Labels | ||
pull-request-stale-label | The label that will be added to the pull request when it is stale. | stale |
pull-request-ignore-all-labels | Allow to ignore the processing of pull requests that contains any labels. | false |
pull-request-ignore-any-labels | Allow to ignore the processing of pull requests that contains one of those labels (multiline). | |
Assignees | ||
pull-request-ignore-all-assignees | Allow to ignore the processing of pull requests that contains any assignees. | false |
pull-request-ignore-any-assignees | Allow to ignore the processing of pull requests that contains one of those assignees (multiline). | |
pull-request-only-with-assignees | Only allow the processing of pull requests that contains at least one assignee. | false |
pull-request-only-any-assignees | Only allow the processing of pull requests that contains one of those assignees (multiline). | |
Project cards | ||
pull-request-ignore-all-project-cards | Allow to ignore the processing of pull requests that contains any project cards. | false |
pull-request-ignore-any-project-cards | Allow to ignore the processing of pull requests that contains one of those project cards (multiline). | |
pull-request-only-with-project-cards | Only allow the processing of pull requests that contains at least one project card. | false |
pull-request-only-any-project-cards | Only allow the processing of pull requests that contains one of those project cards (multiline). | |
Milestones | ||
pull-request-ignore-all-milestones | Allow to ignore the processing of pull requests that contains any milestones. | false |
pull-request-ignore-any-milestones | Allow to ignore the processing of pull requests that contains one of those milestones (multiline). | |
pull-request-only-with-milestones | Only allow the processing of pull requests that contains at least one milestone. | false |
pull-request-only-any-milestones | Only allow the processing of pull requests that contains one of those milestones (multiline). | |
Comments | ||
pull-request-stale-comment | The comment that will be sent once the pull request is stale (keep empty to not send a comment). | |
pull-request-close-comment | The comment that will be sent once the pull request is close (keep empty to not send a comment). | |
Durations | ||
pull-request-days-before-stale | The number of days until the pull request is considered as stale. | 30 |
pull-request-days-before-close | The number of days until a stale pull request is considered as closed. | 10 |
Limiters | ||
pull-request-limit-api-queries-count | Limit the quantity of API queries calls performed during the processing of pull requests (-1 for unlimited). |
-1 |
pull-request-limit-api-mutations-count | Limit the quantity of API mutations calls performed during the processing of pull requests (-1 for unlimited). |
-1 |
pull-request-ignore-before-creation-date | Allow to ignore the processing of pull requests that were created before this date (ISO 8601). | |
pull-request-ignore-draft | Allow to ignore the processing of pull requests that are drafts. | false |
Others | ||
pull-request-processing | Allow to process the pull requests. | true |
pull-request-add-labels-after-stale | A list of labels added when the processing stale the pull request (multiline). | |
pull-request-remove-labels-after-stale | A list of labels removed when the processing stale the pull request (multiline). | |
pull-request-add-labels-after-close | A list of labels added when the processing close the pull request (multiline). | |
pull-request-remove-labels-after-close | A list of labels removed when the processing close the pull request (multiline). | |
pull-request-to-draft-instead-of-stale | Convert the pull request to a draft pull request instead of handling it as a stale candidate. | false |
pull-request-delete-branch-after-close | Delete the branch when the processing close the pull request. | false |
Output | Description |
---|---|
processed-pull-requests-count | The number of pull requests processed. |
ignored-pull-requests-count | The number of pull requests ignored. |
unaltered-pull-requests-count | The number of pull requests unaltered (either not good to stale or already stale). |
stale-pull-requests-count | The number of pull requests stale. |
already-stale-pull-requests-count | The number of pull requests processed which were already stale. |
remove-stale-pull-requests-count | The number of pull requests from where the stale state was removed. |
close-pull-requests-count | The number of pull requests closed. |
deleted-pull-requests-branches-count | The number of deleted pull requests branches closed. |
added-pull-requests-comments-count | The number of added pull requests comments. |
pull-requests-labels-count | The number of mutated pull requests labels (added or removed). |
added-pull-requests-labels-count | The number of added pull requests labels. |
removed-pull-requests-labels-count | The number of removed pull requests labels. |
draft-pull-requests-count | The number of pull requests converted to draft. |
called-api-pull-requests-count | The number of GitHub API calls performed for the pull requests. |
called-api-pull-requests-queries-count | The number of GitHub API queries calls performed for the pull requests. |
called-api-pull-requests-mutations-count | The number of GitHub API mutations calls performed for the pull requests. |
Checkout the documentation to have some examples.
See all the changes on the website.
Check out the contributing file before helping us.
This project is licensed under the MIT License - see the license for details.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification.
Contributions of any kind are welcome!
Geoffrey 'C0ZEN' Testelin was originally a contributor of @actions/stale (see the contributors).
Due to slower cadence and different opinions over how the project should go forward, he decided to start from scratch on his own.
The main difference is that this project aims to provide the best stale action as possible based on consumers needs, even if it may be hard to provide such features. #noLimit - we do what we can to have an amazing stale action ;)