chore: don't delete nightly tag after draft (#22588)

This commit is contained in:
Shelley Vohr 2020-03-10 03:13:10 +00:00 коммит произвёл GitHub
Родитель 8075a55815
Коммит c0374b5796
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -44,7 +44,6 @@ async function deleteDraft (releaseId, targetRepo) {
repo: targetRepo,
release_id: parseInt(releaseId, 10)
})
console.log(result)
if (!result.data.draft) {
console.log(`${fail} published releases cannot be deleted.`)
return false
@ -85,15 +84,11 @@ async function cleanReleaseArtifacts () {
if (releaseId) {
if (isNightly) {
const deletedNightlyDraft = await deleteDraft(releaseId, 'nightlies')
await deleteDraft(releaseId, 'nightlies')
// don't delete tag unless draft deleted successfully
if (deletedNightlyDraft) {
await Promise.all([
deleteTag(args.tag, 'electron'),
deleteTag(args.tag, 'nightlies')
])
}
// We only need to delete the Electron tag since the
// nightly tag is only created at publish-time.
await deleteTag(args.tag, 'electron')
} else {
const deletedElectronDraft = await deleteDraft(releaseId, 'electron')
// don't delete tag unless draft deleted successfully