Skip to content
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

meta: add old issue stalebot #54672

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/close-old-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Close stale issues
on:
schedule:
# Run every day at 1:00 AM UTC.
- cron: 0 1 * * *
workflow_dispatch:
inputs:
endDate:
description: stop processing issues after this date
required: false
type: string

# yamllint disable rule:empty-lines
env:
CLOSE_MESSAGE: >
This issue was opened more than 4 years 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
to do, please leave a comment.

WARN_MESSAGE: >
This issue was opened more than 4 years 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 issue.
# yamllint enable

permissions:
contents: read

jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
if: github.repository == 'nodejs/node'
runs-on: ubuntu-latest
steps:
- name: Set default end date which is 4 year ago
run: echo "END_DATE=$(date --date='2102400 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 != '' }}
run: echo "END_DATE=$END_DATE_INPUT_VALUE" >> "$GITHUB_ENV"
- uses: mhdawson/stale@453d6581568dc43dbe345757f24408d7b451c651 # PR to add support for endDate
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
end-date: ${{ env.END_DATE }}
days-before-pr-stale: -1
days-before-pr-close: -1
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-issue-labels: never-stale, feature requests
# 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