8000 fix: make release-artifact-cleanup executable (backport: 4-0-x) by trop[bot] · Pull Request #15273 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: make release-artifact-cleanup executable (backport: 4-0-x) #15273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions script/release-artifact-cleanup.js
100644 → 100755
7DAC
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if (!process.env.CI) require('dotenv-safe').load()
require('colors')
const args = require('minimist')(process.argv.slice(2), {
boolean: ['tag']
string: ['tag']
})
const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
Expand All @@ -20,7 +20,7 @@ github.authenticate({
})

function getLastBumpCommit (tag) {
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format="format:{hash: %H, message: '%s'}"`)
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format='format:{"hash": "%H", "message": "%s"}'`).toString()
return JSON.parse(data)
}

Expand Down Expand Up @@ -90,9 +90,9 @@ async function deleteTag (tag, targetRepo) {

async function cleanReleaseArtifacts () {
const tag = args.tag
const lastBumpCommit = getLastBumpCommit().message
const isNightly = args.tag.includes('nightly')

if (lastBumpCommit.indexOf('nightly' > 0)) {
if (isNightly) {
await deleteDraft(tag, 'nightlies')
await deleteTag(tag, 'nightlies')
} else {
Expand Down
0