Handle retired maintenance refs during Alpha publication [ci skip]

A branch rename can remove the ref while a runtime build is running. Keep the verified artifact and skip automatic publication when Git succeeds with no match. Preserve the checks for a failed query or a superseded commit.
This commit is contained in:
YXC0915 committed 2026-12-02 19:41:01 +08:00
1 parent e8083c97ea
commit 57024d3ab1
1 file changed
+7 -2
+7 -2
View File
@@ -259,8 +259,13 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'
if ($env:CURRENT_ONLY -eq 'true') {
$remote = git ls-remote $env:UPSTREAM_URL "refs/heads/$env:UPSTREAM_BRANCH"
if ($LASTEXITCODE -or !$remote) { throw 'Could not resolve the runtime maintenance tip' }
$ref = "refs/heads/$env:UPSTREAM_BRANCH"
$remote = git ls-remote $env:UPSTREAM_URL $ref
if ($LASTEXITCODE -ne 0) { throw "Could not query the runtime maintenance ref $ref" }
if (!$remote) {
Write-Warning "Skipping Alpha publication because $ref no longer exists. The verified archives are available in the workflow artifact."
return
}
if (($remote -split '\s+')[0] -ne '${{ needs.resolve.outputs.commit }}') {
Write-Host 'Skipping Alpha publication for a superseded runtime commit.'
return