Allow Setting Different Labels When Auto-closing Issues

This commit is contained in:
Stripes
2023-04-08 13:21:03 +03:00
committed by GitHub
parent 7e7238569e
commit 403ef3fc2e
+4 -4
View File
@@ -83,14 +83,14 @@ const syncLabels = (postId, proposedLabels, allLabels) => {
}
const closeIssueQueue = asyncQueue((task, cb) => {
closeIssue(task.postId).then(() => { cb() }).catch(() => { cb() })
closeIssue(task.postId, task.label).then(() => { cb() }).catch(() => { cb() })
})
const closeIssue = (postId) => {
// also adds label "very low score"
const closeIssue = (postId, label) => {
// also adds label to the issue if label id provided
return request(
`mutation {
updateIssue(input: {id : "${postId}" , state: CLOSED${config['label-id-for-close-issues'] ? ', labelIds: ["' + config['label-id-for-close-issues'] + '"]' : ''} }){
updateIssue(input: {id : "${postId}" , state: CLOSED${label ? ', labelIds: ["' + label + '"]' : ''} }){
issue {
id
title