From 177e4c82b8958c73ae869f795cbb63a01b260deb Mon Sep 17 00:00:00 2001 From: Yuri <105006434+uyriq@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:46:53 +0100 Subject: [PATCH] Fix release.yml to correctly fetch tag name during code checkout --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bd07b1..4e0f5cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,11 @@ jobs: id: extract_tag_name shell: pwsh run: | - $tagName = $env:GITHUB_REF -replace 'refs/tags/', '' + if ($env:GITHUB_REF -match 'refs/tags/(.*)') { + $tagName = $matches[1] + } else { + $tagName = git describe --tags $(git rev-list --tags --max-count=1) + } Write-Host "Tag name: $tagName" echo "TAG_NAME=$tagName" >> $env:GITHUB_ENV