Skip to content

Commit

Permalink
update tag release workflow (#420)
Browse files Browse the repository at this point in the history
Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com>
  • Loading branch information
rdhar authored Feb 17, 2025
1 parent 04e32fa commit 1f40445
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/ci_release.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/tag_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Tag Release

on:
release:
types: [created]

jobs:
tag:
runs-on: ubuntu-24.04

permissions:
contents: write # Required for tag operation.

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Fetch tag history.
persist-credentials: false

- name: Tag release version
env:
GH_TOKEN: ${{ github.token }}
GH_TAG: ${{ github.event.release.tag_name}}
run: |
version=${GH_TAG%%.*}
gh api /repos/${{ github.repository }}/git/refs/tags/${version} --method PATCH --silent --field sha="${GITHUB_SHA}" --field force=true || \
gh api /repos/${{ github.repository }}/git/refs --method POST --silent --field sha="${GITHUB_SHA}" --field ref="refs/tags/${version}"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: TF Tests
name: Tests

on:
pull_request:
Expand Down

0 comments on commit 1f40445

Please sign in to comment.