ci(release): fix tag existence check for remote
- detect tag by non-empty ls-remote output instead of exit code
This commit is contained in:
@@ -53,9 +53,8 @@ jobs:
|
||||
run: |
|
||||
$version = "${{ steps.extract_version.outputs.version }}"
|
||||
$tag = "v$version"
|
||||
git ls-remote --tags origin "refs/tags/$tag" | Out-Null
|
||||
$tagExists = ($LASTEXITCODE -eq 0)
|
||||
$global:LASTEXITCODE = 0
|
||||
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
|
||||
$tagExists = -not [string]::IsNullOrWhiteSpace($tagLine)
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||
if ($tagExists) {
|
||||
Write-Host "Version $tag already released, stopping job."
|
||||
|
||||
Reference in New Issue
Block a user