Commit 05ae0c83
05ae0c831a41Merged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 1 file ยท +1 added
Description
feat: create release-tag.yml
Signed-off-by: Dmitriy Zhilyaev [email protected]
Details
- Commit
- 05ae0c831a41
- Parent
- 8fec734ab60f
.github/workflows/release-tag.ymladdedView file
1+
name: Create tag base on release branch2+
3+
on:4+
pull_request:5+
branches:6+
- main7+
types:8+
- closed9+
10+
jobs:11+
tagger:12+
runs-on: ubuntu-latest13+
permissions:14+
contents: write # to create new tag15+
if: startsWith(github.event.pull_request.head.ref, 'release/')16+
steps:17+
- name: Create tag18+
id: create19+
uses: actions/github-script@v720+
with:21+
github-token: ${{ github.token }}22+
script: |23+
const tag = context.payload.pull_request.head.ref.replace("release/", "v")24+
try {25+
await github.rest.git.deleteRef({26+
owner: context.repo.owner,27+
repo: context.repo.repo,28+
ref: "refs/tags/" + tag,29+
})30+
} catch {31+
}32+
await github.rest.git.createRef({33+
owner: context.repo.owner,34+
repo: context.repo.repo,35+
ref: "refs/tags/" + tag,36+
sha: context.payload.pull_request.merge_commit_sha,37+
})38+
return tag39+
result-encoding: string