From bd90755831e5ea14a792f48c90ea558d86231cd9 Mon Sep 17 00:00:00 2001 From: robobun <117481402+robobun@users.noreply.github.com> Date: Thu, 27 Aug 2026 11:00:39 +0000 Subject: [PATCH] ci: run the Scoop installer as a script file, not through Invoke-Expression ScoopInstaller/Install#136 (2026-08-27) made install.ps1 skip the install flow when it is dot-sourced: the script now only calls Install-Scoop when $MyInvocation.InvocationName is not '.'. GitHub Actions runs a pwsh step by dot-sourcing the step script, so `irm get.scoop.sh | iex` inherits that invocation name, defines the functions and exits without installing. The next step then fails on `scoop config` within a second. Every Preview Build and release build in this repository has failed that way on the windows-11-arm job since 09:48 UTC. Download the installer to a file and run it with the call operator, whose invocation name is the file path, and fail the step if scoop.ps1 is not in the shims directory afterwards. --- .github/workflows/build-reusable.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index 9cfcdaa7f515f..86ba0eefc4f07 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -257,7 +257,15 @@ jobs: - name: Install Scoop run: | Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser - Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression + # Since ScoopInstaller/Install#136 the installer only installs when it is not + # dot-sourced, and Actions dot-sources the step script, so `irm | iex` only + # defines its functions. Run the script as a file with the call operator instead. + $scoopInstaller = Join-Path $env:RUNNER_TEMP "install-scoop.ps1" + Invoke-RestMethod -Uri https://get.scoop.sh -OutFile $scoopInstaller + & $scoopInstaller + if (-not (Test-Path (Join-Path (Resolve-Path ~).Path "scoop\shims\scoop.ps1"))) { + throw "Scoop did not install" + } Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH - name: Install LLVM and Ninja (ARM64) if: matrix.platform == 'ARM64'