ci(release): fix tag existence check for remote
Some checks are pending
Desktop CI / tests (push) Successful in 12s
Desktop Release / release (push) Has started running

- detect tag by non-empty ls-remote output instead of exit code
This commit is contained in:
2026-02-15 21:00:36 +03:00
parent f15e71996b
commit 1013a1ce38

View File

@@ -53,9 +53,8 @@ jobs:
run: | run: |
$version = "${{ steps.extract_version.outputs.version }}" $version = "${{ steps.extract_version.outputs.version }}"
$tag = "v$version" $tag = "v$version"
git ls-remote --tags origin "refs/tags/$tag" | Out-Null $tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
$tagExists = ($LASTEXITCODE -eq 0) $tagExists = -not [string]::IsNullOrWhiteSpace($tagLine)
$global:LASTEXITCODE = 0
$utf8NoBom = New-Object System.Text.UTF8Encoding($false) $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
if ($tagExists) { if ($tagExists) {
Write-Host "Version $tag already released, stopping job." Write-Host "Version $tag already released, stopping job."