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: |
|
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."
|
||||||
|
|||||||
Reference in New Issue
Block a user