-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
build: add action to close stale PRs #48051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1281e7a
build: add action to close stale PRs
mhdawson 32b70ec
Update .github/workflows/close-stale-pull-requests.yml
mhdawson 6fce53c
Update doc/contributing/pull-requests.md
mhdawson 4cf14cc
Update doc/contributing/pull-requests.md
mhdawson 866b658
Update .github/workflows/close-stale-pull-requests.yml
mhdawson db09a96
Update .github/workflows/close-stale-pull-requests.yml
mhdawson 76512bf
Update .github/workflows/close-stale-pull-requests.yml
mhdawson 70012f0
Update .github/workflows/close-stale-pull-requests.yml
mhdawson ccf0221
Update .github/workflows/close-stale-pull-requests.yml
mhdawson 417f6af
Update .github/workflows/close-stale-pull-requests.yml
mhdawson 7afb9f1
squash: address comments
mhdawson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Close stale feature requests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
endDate: | ||
description: stop processing PRs after this date | ||
required: false | ||
type: string | ||
schedule: | ||
# Run every day at 1:00 AM UTC. | ||
- cron: 0 1 * * * | ||
|
||
# yamllint disable rule:empty-lines | ||
env: | ||
CLOSE_MESSAGE: > | ||
This pull request was opened more than a year ago and there has | ||
been no activity in the last 6 months. We value your contribution | ||
but since it has not progressed in the last 6 months it is being | ||
closed. If you feel closing this issue is not the right thing | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
to do, please leave a comment. | ||
|
||
|
||
For more information on how the project manages pull requests, | ||
please consult the | ||
[pull requests](https://github.com/nodejs/node/blob/main/doc/contributing/pull-requests.md#managing-stale-pull-requests). | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
WARN_MESSAGE: > | ||
This pull request was opened more than a year ago and there has | ||
been no activity in the last 5 months. We value your contribution | ||
but since it has not progressed in the last 5 months it is being | ||
marked stale and will be closed if there is no progress in the | ||
next month. If you feel that is not the right thing to do please | ||
comment on the pull request. | ||
|
||
|
||
For more information on how the project manages pull requests, | ||
please consult the | ||
[pull requests](https://github.com/nodejs/node/blob/main/doc/contributing/pull-requests.md#managing-stale-pull-requests). | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# yamllint enable | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
stale: | ||
permissions: | ||
pull-requests: write # for actions/stale to close stale PRs | ||
if: github.repository == 'nodejs/node' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set default end date which is 1 year ago | ||
run: echo "END_DATE=$(date --date='525600 minutes ago' --rfc-2822)" >> "$GITHUB_ENV" | ||
- name: if date set in event override the default end date | ||
env: | ||
END_DATE_INPUT_VALUE: ${{ github.event.inputs.endDate }} | ||
if: "${{ github.event.inputs.endDate != '' }}" | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: echo "END_DATE=$END_DATE_INPUT_VALUE" >> "$GITHUB_ENV" | ||
# - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: mhdawson/stale@453d6581568dc43dbe345757f24408d7b451c651 # PR to add support for endDate | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
end-date: ${{ env.END_DATE }} | ||
days-before-issue-stale: -1 | ||
days-before-issue-close: -1 | ||
only-labels: test-stale-pr | ||
days-before-stale: 150 | ||
days-before-close: 30 | ||
stale-issue-label: stale | ||
close-issue-message: ${{ env.CLOSE_MESSAGE }} | ||
stale-issue-message: ${{ env.WARN_MESSAGE }} | ||
exempt-pr-labels: never-stale | ||
# max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits | ||
operations-per-run: 500 | ||
remove-stale-when-updated: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.