Issue Management (#628)

* better issue templates, forcing issue template

* close issues workflow

* closeissues workflow change
This commit is contained in:
Richard Guo
2023-05-18 13:11:45 -04:00
committed by GitHub
parent 0bd4c4ce29
commit d1e65e8d1c
8 changed files with 165 additions and 66 deletions

26
.github/workflows/close_issues.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
# This workflow will close issues that do not have labels or additional comments.
# Trigger manually.
name: "Close Issues"
on:
workflow_dispatch:
jobs:
close_issues:
runs-on: ubuntu-latest
steps:
- name: Close issues without label or comment
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const repo = context.repo;
const issues = await github.issues.listForRepo(repo);
for (let { number } of issues.data) {
const issueData = await github.issues.get({...repo, issue_number: number});
const comments = await github.issues.listComments({...repo, issue_number: number});
if (issueData.data.labels.length === 0 && comments.data.length < 1) {
await github.issues.update({...repo, issue_number: number, state: 'closed'});
await github.issues.createComment({...repo, issue_number: number, body: 'Issue closed as it does not have any labels or comments.'});
}
}