fix(windows-e2e): 'auto' sentinel for install-ref - powershell -File eats empty-string args

Run 31520267702 died in 3s: 'Missing an argument for parameter
InstallRef'. powershell.exe -File drops a "" argument from the command
line entirely, so the parameter binder saw -InstallRef followed by
-SetupExeUrl. Default both the workflow input and the script parameter
to 'auto' (= newest release tag) instead of empty.
This commit is contained in:
ethernet
2026-08-11 14:01:22 -04:00
parent 2a906ac6a0
commit e8bdb6933e
2 changed files with 9 additions and 7 deletions
@@ -41,10 +41,10 @@ on:
type: string
default: desktop
install-ref:
description: 'Ref to install as OLD (served as main while the installer runs). Empty = the newest release tag in the checkout.'
description: 'Ref to install as OLD (served as main while the installer runs). auto = the newest release tag in the checkout.'
required: false
type: string
default: ''
default: auto
setup-exe-url:
description: 'Bootstrap installer to install OLD with. Default: the latest published one — what a user downloads today.'
required: false
+7 -5
View File
@@ -82,10 +82,12 @@ param(
# i.e. what the user starts on. The published Hermes-Setup.exe carries
# no commit pin (Pin { commit: None, branch: "main" }) -- it installs
# whatever `main` points at, so staging OLD means serving it there.
# Empty = newest release tag in the checkout (the "user on the current
# release" starting point, same philosophy as the linux axis's tag
# matrix).
[string]$InstallRef = "",
# Empty or "auto" = newest release tag in the checkout (the "user on
# the current release" starting point, same philosophy as the linux
# axis's tag matrix). "auto" exists because `powershell -File` silently
# swallows an empty-string argument ('Missing an argument for
# parameter'), so the workflow cannot pass "".
[string]$InstallRef = "auto",
# Repo checkout whose HEAD is the update target.
[string]$RepoRoot = "",
@@ -301,7 +303,7 @@ function Invoke-PhaseStage {
# OLD: explicit -InstallRef, or the newest release tag -- the version a
# user who installed on release day is on.
$oldRef = $InstallRef
if (-not $oldRef) {
if (-not $oldRef -or $oldRef -eq "auto") {
$oldRef = (Invoke-Git @("-C", $RepoRoot, "tag", "--list", "v*", "--sort=-creatordate") -split "`r?`n" | Select-Object -First 1)
if (-not $oldRef) { throw "no v* release tags in the checkout and no -InstallRef given -- cannot pick an OLD version" }
}