Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

use not_planned close reason #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/stale.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module.exports = class Stale {
if (closeComment) {
await this.github.issues.createComment({ owner, repo, number, body: closeComment })
}
return this.github.issues.edit({ owner, repo, number, state: 'closed' })
return this.github.issues.update({ owner, repo, number, state: 'closed', state_reason: 'not_planned' })
} else {
this.logger.info('%s/%s#%d would have been closed (dry-run)', owner, repo, number)
}
Expand Down
5 changes: 3 additions & 2 deletions test/stale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('stale', () => {
createLabel: issueAction,
addLabels: issueAction,
createComment: issueAction,
edit: issueAction
update: issueAction
},
search: {
issues: issueAction
Expand Down Expand Up @@ -108,8 +108,9 @@ describe('stale', () => {
comments++
return Promise.resolve(notFoundError)
})
github.issues.edit = ({ owner, repo, number, state }) => {
github.issues.update = ({ owner, repo, number, state, state_reason }) => {
if (state === 'closed') {
expect(state_reason).toBe('not_planned')
closed++
}
}
Expand Down