ci: reset LASTEXITCODE before natural script end; match build-job exit pattern

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 17:21:31 +00:00
parent 6c32c913f4
commit 2aad6e5863
+5 -5
View File
@@ -284,12 +284,12 @@ jobs:
} finally {
try { Stop-Transcript -ErrorAction SilentlyContinue } catch {}
}
# Persist exit code to a side-channel file so we can inspect even if
# the transcript got closed before the value was written.
"code=$code at $(Get-Date)" | Out-File -FilePath publish-finish.log -Encoding ASCII
# Force explicit exit -- ignore any trailing $LASTEXITCODE noise from
# native commands above.
if ($code -ne 0) { exit $code } else { exit 0 }
# Match the build-job pattern: only exit non-zero on failure. Don't
# call `exit 0` -- PowerShell's natural end-of-script propagates the
# last $LASTEXITCODE (which is 0 after our final cmdlet).
$global:LASTEXITCODE = 0
if ($code -ne 0) { exit $code }
- name: Pack + upload publish.tar.gz
if: success()