chore: pass tag correctly for bump commit reversion (#14444)
This commit is contained in:
parent
c63014c256
commit
4c09142f61
1 changed files with 4 additions and 4 deletions
|
@ -19,8 +19,8 @@ github.authenticate({
|
||||||
token: process.env.ELECTRON_GITHUB_TOKEN
|
token: process.env.ELECTRON_GITHUB_TOKEN
|
||||||
})
|
})
|
||||||
|
|
||||||
function getLastBumpCommit () {
|
function getLastBumpCommit (tag) {
|
||||||
const data = execSync(`git log -n1 --grep "Bump v[0-9.]*" --format="format:{hash: %H, message: '%s'}"`)
|
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format="format:{hash: %H, message: '%s'}"`)
|
||||||
return JSON.parse(data)
|
return JSON.parse(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ async function getCurrentBranch (gitDir) {
|
||||||
|
|
||||||
async function revertBumpCommit (tag) {
|
async function revertBumpCommit (tag) {
|
||||||
const branch = getCurrentBranch()
|
const branch = getCurrentBranch()
|
||||||
const commitToRevert = getLastBumpCommit().hash
|
const commitToRevert = getLastBumpCommit(tag).hash
|
||||||
await GitProcess.exec(['revert', commitToRevert], gitDir)
|
await GitProcess.exec(['revert', commitToRevert], gitDir)
|
||||||
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], gitDir)
|
const pushDetails = await GitProcess.exec(['push', 'origin', `HEAD:${branch}`, '--follow-tags'], gitDir)
|
||||||
if (pushDetails.exitCode === 0) {
|
if (pushDetails.exitCode === 0) {
|
||||||
|
@ -100,7 +100,7 @@ async function cleanReleaseArtifacts () {
|
||||||
}
|
}
|
||||||
|
|
||||||
await deleteTag(tag, 'electron')
|
await deleteTag(tag, 'electron')
|
||||||
await revertBumpCommit()
|
await revertBumpCommit(tag)
|
||||||
|
|
||||||
console.log('Failed release artifact cleanup complete')
|
console.log('Failed release artifact cleanup complete')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue