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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user