Files
freeCodeCamp/prOpenClose.js
2018-11-06 23:04:43 -08:00

15 lines
370 B
JavaScript

const prOpenClose = async () => {
const result = await octokit.pullRequests.update({ owner, repo , number, state: 'closed', base })
.then(() => {
return octokit.pullRequests.update({ owner, repo , number, state: 'open', base })
})
.then(() => {
log.update(true)
})
.catch(() => {
log.update(false)
})
};
exports.changePrState = changePrState;