fix(ci): don't splat empty --commit (PS5.1 drops zero-length args)

PowerShell 5.1 drops a zero-length string when splatting to a native
exe, so an empty $repoCommit shifted flag/value pairing and click saw
the build command as an unexpected positional. Append --commit only
when a commit is set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Simone
2026-05-17 17:39:36 +02:00
parent ed4dc793f5
commit 2b8011c35d
+4 -1
View File
@@ -299,12 +299,14 @@ runs:
}
# Build argument list for the Python CLI. Long-form kebab-case flags only.
# NOTE: never put an empty string in the splatted array — PowerShell
# 5.1 drops zero-length args when calling a native exe, which would
# shift the flag/value pairing. Add optional args conditionally.
$pyArgs = @(
'-m', 'ci_orchestrator', 'job',
'--job-id', $jobId,
'--repo-url', $repoUrl,
'--branch', $repoBranch,
'--commit', $repoCommit,
'--build-command', $env:INPUT_BUILD_COMMAND,
'--guest-artifact-source', $env:INPUT_ARTIFACT_SOURCE,
'--guest-os', $resolvedGuestOS,
@@ -312,6 +314,7 @@ runs:
'--template-path', $resolvedTemplatePath,
'--snapshot-name', $resolvedSnapshotName
)
if ($repoCommit) { $pyArgs += @('--commit', $repoCommit) }
# Submodules and transport default to ON; pass the explicit
# negative flag when the caller opted out so the Python default