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 {
|
} finally {
|
||||||
try { Stop-Transcript -ErrorAction SilentlyContinue } catch {}
|
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
|
"code=$code at $(Get-Date)" | Out-File -FilePath publish-finish.log -Encoding ASCII
|
||||||
# Force explicit exit -- ignore any trailing $LASTEXITCODE noise from
|
# Match the build-job pattern: only exit non-zero on failure. Don't
|
||||||
# native commands above.
|
# call `exit 0` -- PowerShell's natural end-of-script propagates the
|
||||||
if ($code -ne 0) { exit $code } else { exit 0 }
|
# last $LASTEXITCODE (which is 0 after our final cmdlet).
|
||||||
|
$global:LASTEXITCODE = 0
|
||||||
|
if ($code -ne 0) { exit $code }
|
||||||
|
|
||||||
- name: Pack + upload publish.tar.gz
|
- name: Pack + upload publish.tar.gz
|
||||||
if: success()
|
if: success()
|
||||||
|
|||||||
Reference in New Issue
Block a user