From ddbd595f2f0c2166c086b294b878db192a65903b Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 1 Jun 2026 08:38:22 +0200 Subject: [PATCH] fix(ci): link Windows hydrate node modules --- .github/workflows/crabbox-hydrate.yml | 10 ++++++++++ test/scripts/package-acceptance-workflow.test.ts | 3 +++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/crabbox-hydrate.yml b/.github/workflows/crabbox-hydrate.yml index 5266602630ca..29f0a6f727ea 100644 --- a/.github/workflows/crabbox-hydrate.yml +++ b/.github/workflows/crabbox-hydrate.yml @@ -431,6 +431,16 @@ jobs: if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $workspaceNodeModules = Join-Path $workspace "node_modules" + if (Test-Path $workspaceNodeModules) { + $workspaceNodeModulesItem = Get-Item $workspaceNodeModules -Force + if (($workspaceNodeModulesItem.Attributes -band [System.IO.FileAttributes]::ReparsePoint) -eq 0) { + throw "workspace node_modules exists and is not a link: $workspaceNodeModules" + } + } else { + New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR | Out-Null + } + $corepackShimDir = Join-Path $nodeBin "node_modules\corepack\shims" if (Test-Path $corepackShimDir) { $env:PNPM_HOME = $corepackShimDir diff --git a/test/scripts/package-acceptance-workflow.test.ts b/test/scripts/package-acceptance-workflow.test.ts index 9ffe8d742212..25b49d5c92f7 100644 --- a/test/scripts/package-acceptance-workflow.test.ts +++ b/test/scripts/package-acceptance-workflow.test.ts @@ -178,6 +178,9 @@ describe("package acceptance workflow", () => { ); expect(hydrateWindowsPnpm.run).toContain('"--filter",'); expect(hydrateWindowsPnpm.run).toContain('"openclaw",'); + expect(hydrateWindowsPnpm.run).toContain( + 'New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR', + ); expect(hydrateWindowsPnpm.run).not.toContain("Remove-Item -Recurse -Force"); expect(hydrateWindowsPnpm.run).not.toContain("Add-Content -Path $env:GITHUB_ENV"); expect(hydrateWindowsPnpm.run).not.toContain("Add-Content -Path $env:GITHUB_PATH");