Browse Source

chore: always try to nuke tags (#16453)

trop[bot] 6 years ago
parent
commit
89ea2105a5
1 changed files with 9 additions and 3 deletions
  1. 9 3
      script/release-artifact-cleanup.js

+ 9 - 3
script/release-artifact-cleanup.js

@@ -96,9 +96,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([
@@ -113,11 +117,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`)
 }