Auto closing issues that needs logs after 7 days of inactivity. (#21390)

* Adding old issue

* Adding needs more info

* Making a different step for every issue label
This commit is contained in:
Aasim Khan
2022-12-12 12:31:47 -08:00
committed by GitHub
parent abc7ada902
commit 30f4a3554a
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
name: Close old issues that need reply
on:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Close old issues labeled 'Need logs' that need reply.
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: Needs Logs
days-before-close: 7
close-comment: "This issue hasn't had any recent activity and we are marking it as closed. If you are still experiencing this issue, please reopen this issue"
- name: Close old issues labeled 'Need Logs - Azure ' that need reply.
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: Needs Logs - Azure
days-before-close: 7
close-comment: "This issue hasn't had any recent activity and we are marking it as closed. If you are still experiencing this issue, please reopen this issue"
- name: Close old issues labeled 'Need More Info' that need reply.
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: Needs More Info
days-before-close: 7
close-comment: "This issue hasn't had any recent activity and we are marking it as closed. If you are still experiencing this issue, please reopen this issue"

26
.github/workflows/on-issue-comment.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: On issue comment
on:
issue_comment:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
if: |
github.event.comment.author_association != 'OWNER' &&
github.event.comment.author_association != 'COLLABORATOR'
steps:
- name: Remove needs-reply label
uses: octokit/request-action@v2.x
continue-on-error: true
with:
route: DELETE /repos/:repository/issues/:issue/labels/:label
repository: ${{ github.repository }}
issue: ${{ github.event.issue.number }}
labels: |
Needs Logs
Needs Logs - Azure
Needs More Info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}