chore: always try to nuke tags (#16451)

This commit is contained in:
Shelley Vohr 2019-01-18 14:00:15 -08:00 committed by GitHub
parent 7f4064af16
commit 3417c42bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,9 +84,13 @@ async function cleanReleaseArtifacts () {
const releaseId = args.releaseID.length > 0 ? args.releaseID : null
const isNightly = args.tag.includes('nightly')
// try to revert commit regardless of tag and draft deletion status
await revertBumpCommit(args.tag)
if (releaseId) {
if (isNightly) {
const deletedNightlyDraft = await deleteDraft(releaseId, 'nightlies')
// don't delete tag unless draft deleted successfully
if (deletedNightlyDraft) {
await Promise.all([
@ -101,11 +105,13 @@ async function cleanReleaseArtifacts () {
await deleteTag(args.tag, 'electron')
}
}
} else {
await Promise.all([
deleteTag(args.tag, 'electron'),
deleteTag(args.tag, 'nightlies')
])
}
// try to revert commit regardless of tag and draft deletion status
await revertBumpCommit(args.tag)
console.log(`${pass} failed release artifact cleanup complete`)
}