Github Action to Close Stale Issues (#3292)

* close stale issues bot

* updated to daily. will run via actions tab to test

* assigned stale-issue-label instead of stale-pr-label

* added another monthly bot to clear year-old issues

* adjusted days before closing old issues to 30

* removed automatic old issue closing
This commit is contained in:
snehara99 2023-09-06 11:35:03 -07:00 коммит произвёл GitHub
Родитель 21548dcea0
Коммит 485e538d8f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 62 добавлений и 0 удалений

29
.github/workflows/close-old-issues.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,29 @@
name: Close Old Issues
on:
workflow_dispatch:
inputs:
readonly:
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
default: false
jobs:
stale:
runs-on: ubuntu-latest
env:
stale-days: 720
close-days: 30
stale-label: stale-old
stale-exempt-label: stale-exempt
steps:
- uses: actions/stale@v4.1.1
with:
stale-issue-label: $stale-label
exempt-issue-labels: $stale-exempt-label
days-before-pr-stale: -1
days-before-pr-close: -1
days-before-stale: $stale-days
stale-issue-message: "This issue is now marked as '$stale-label' due to there being no activity on it for the past $stale-days days. Unless the '$stale-label' label is removed or the issue is commented on, this will be remain open for at least $close-days days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the '$stale-exempt-label' label."
days-before-close: $close-days
close-issue-reason: not_planned
close-issue-message: "This issue is now closed due to there being no activity on it for the past $close-days days since being marked as '$stale-label'."
operations-per-run: 50

33
.github/workflows/close-stale-issues.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,33 @@
name: Close Stale Issues
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
readonly:
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
default: false
jobs:
stale:
runs-on: ubuntu-latest
env:
stale-days: 60
close-days: 7
stale-label: stale
stale-exempt-label: stale-exempt
only-label: needs more info
steps:
- uses: actions/stale@v4.1.1
with:
stale-issue-label: $stale-label
exempt-issue-labels: $stale-exempt-label
only-label: $only-label
days-before-pr-stale: -1
days-before-pr-close: -1
days-before-stale: $stale-days
stale-issue-message: "This issue is now marked as '$stale-label' due to there being no activity on it for the past $stale-days days and being labelled '$only-label'. Unless the '$stale-label' label is removed or the issue is commented on, this will be closed in $close-days days. If you would like to make this issue exempt from getting stale, please remove the 'more info needed' label or add the '$stale-exempt-label' label"
days-before-close: $close-days
close-issue-reason: not_planned
close-issue-message: "This issue is now closed due to there being no activity on it for the past $close-days days since being marked as '$stale-label'."
operations-per-run: 50