From 2b8011c35dd4861de4f641a76e78e489594426f8 Mon Sep 17 00:00:00 2001 From: Simone Date: Sun, 17 May 2026 17:39:36 +0200 Subject: [PATCH] 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 --- .gitea/actions/local-ci-build/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/actions/local-ci-build/action.yml b/.gitea/actions/local-ci-build/action.yml index c265624..8564e98 100644 --- a/.gitea/actions/local-ci-build/action.yml +++ b/.gitea/actions/local-ci-build/action.yml @@ -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