From a21845327baaf44abd17ed8493b65639e04ecb86 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 29 Aug 2024 21:21:19 -0500 Subject: [PATCH] Update pre-release.yaml --- .github/workflows/pre-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index d6ee1d4f..bf2e78fb 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -78,8 +78,8 @@ jobs: id: get_latest_release run: | git fetch --tags --force - $latestTag = git describe --tags --abbrev=0 - if ($LASTEXITCODE -ne 0) { + $latestTag = git for-each-ref --sort=-creatordate --format '%(refname:short)' refs/tags --count 1 + if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrEmpty($latestTag)) { Write-Error "Failed to get latest tag. Error code: $LASTEXITCODE" exit 1 }