Commit fc6f6147
fc6f61473eaeMerged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 1 file ยท ~1 modified
Description
fix(ci): always create tag
Signed-off-by: Dmitriy Zhilyaev [email protected]
Details
- Commit
- fc6f61473eae
- Parent
- e2be78253b20
.github/workflows/release-tag.ymlmodifiedView file
@@ -22,19 +22,16 @@
2222
github-token: ${{ secrets.PAT }}2323
script: |2424
const tag = context.payload.pull_request.head.ref.replace("release/", "v")25-
try {26-
await github.rest.git.deleteRef({25+
const ref = {2726
owner: context.repo.owner,2827
repo: context.repo.repo,2928
ref: "refs/tags/" + tag,30-
})31-
} catch {29+
sha: context.payload.pull_request.merge_commit_sha,3230
}33-
await github.rest.git.createRef({34-
owner: context.repo.owner,35-
repo: context.repo.repo,36-
ref: "refs/tags/" + tag,37-
sha: context.payload.pull_request.merge_commit_sha,31+
32+
github.rest.git.createRef(ref).catch(err => {33+
if (err.status !== 422) throw err;34+
github.rest.git.updateRef(ref);3835
})39-
return tag4036
result-encoding: string37+