chore: result => result.data (#16274)

* chore: result.draft => result.data.draft

* also result.id
This commit is contained in:
Shelley Vohr 2019-01-04 11:26:14 -08:00 committed by GitHub
parent 21d1849723
commit c1ca8476f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,14 +50,14 @@ async function deleteDraft (releaseId, targetRepo) {
id: parseInt(releaseId, 10)
})
console.log(result)
if (!result.draft) {
if (!result.data.draft) {
console.log(`${fail} published releases cannot be deleted.`)
return false
} else {
await github.repos.deleteRelease({
owner: 'electron',
repo: targetRepo,
release_id: result.id
release_id: result.data.id
})
}
console.log(`${pass} successfully deleted draft with id ${releaseId} from ${targetRepo}`)