Skip to content

Commit 2c860e4

Browse files
authored
update tag release workflow (#17)
Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com>
1 parent 5e42782 commit 2c860e4

3 files changed

Lines changed: 29 additions & 24 deletions

File tree

.github/workflows/ci_release.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/tag_release.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Tag Release
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
tag:
10+
runs-on: ubuntu-24.04
11+
12+
permissions:
13+
contents: write # Required for tag operation.
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
fetch-depth: 0 # Fetch tag history.
20+
persist-credentials: false
21+
22+
- name: Tag release version
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
GH_TAG: ${{ github.event.release.tag_name}}
26+
run: |
27+
version=${GH_TAG%%.*}
28+
gh api /repos/${{ github.repository }}/git/refs/tags/${version} --method PATCH --silent --field sha="${GITHUB_SHA}" --field force=true || \
29+
gh api /repos/${{ github.repository }}/git/refs --method POST --silent --field sha="${GITHUB_SHA}" --field ref="refs/tags/${version}"

0 commit comments

Comments
 (0)