Commit a824fb90
a824fb908acaMerged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 1 file ยท ~1 modified
Description
fix(ci): force create tag 1
Signed-off-by: Dmitriy Zhilyaev [email protected]
Details
- Commit
- a824fb908aca
- Parent
- 528192f6cad9
.github/workflows/release-tag.ymlmodifiedView file
@@ -27,23 +27,24 @@
2727
repo: context.repo.repo,2828
ref: 'refs/tags/' + tag,2929
sha: context.payload.pull_request.merge_commit_sha,30-
force: true,3130
}3231
3332
try {34-
const r = await github.rest.git.createRef(ref)35-
console.log("tag has been created")33+
await github.rest.git.getRef(ref);34+
await github.rest.git.updateRef({...ref, force: true});35+
console.log("tag has been updated");36+
3637
} catch (err) {37-
if (err.status == 422) { 38-
await github.rest.git.updateRef(ref) 39-
console.log("tag has been updated")40-
}41-
else { 42-
console.log("just error")43-
throw error38+
if (err.status === 404) {39+
await github.rest.git.createRef(ref);40+
console.log("tag has been created");41+
} else {42+
console.log("just error");43+
throw err;4444
}4545
}4646
4747
result-encoding: string48+
retry-exempt-status-codes: 400,4014849
debug: true4950