Commit aa20d77b
aa20d77b0f4fMerged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 1 file ยท ~1 modified
Description
fix(ci): force create tag
Signed-off-by: Dmitriy Zhilyaev [email protected]
Details
- Commit
- aa20d77b0f4f
- Parent
- 4e244dc16551
.github/workflows/release-tag.ymlmodifiedView file
@@ -20,17 +20,28 @@
2020
with:2121
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow2222
github-token: ${{ secrets.PAT }}23-
script: |24-
const tag = context.payload.pull_request.head.ref.replace("release/", "v")23+
script: |-224+
const tag = context.payload.pull_request.head.ref.replace("release/", "v");2525
const ref = {2626
owner: context.repo.owner,2727
repo: context.repo.repo,28-
ref: "refs/tags/" + tag,28+
ref: 'refs/tags/' + tag,2929
sha: context.payload.pull_request.merge_commit_sha,3030
}31-
32-
github.rest.git.createRef(ref).catch(err => {33-
if (err.status == 422) github.rest.git.updateRef(ref);34-
})31+
32+
try {33+
const r = await github.rest.git.createRef(ref)34+
console.log("tag has been created")35+
} catch (err) {36+
if (err.status == 422) { 37+
await github.rest.git.updateRef(ref) 38+
console.log("tag has been updated")39+
}40+
else { 41+
console.log("just error")42+
throw error43+
}44+
}45+
3546
result-encoding: string3647