Update close_issues.yml (#629)

Signed-off-by: Richard Guo <richardg7890@gmail.com>
This commit is contained in:
Richard Guo 2023-05-18 13:17:31 -04:00 committed by GitHub
parent d1e65e8d1c
commit 546600fb68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ jobs:
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) {
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.'});
}