Skip to content

Commit ffec6ed

Browse files
wan9chiclaude
andcommitted
ci(remote-cache): run the standalone check with a native pnpm executable
`npm_execpath` points to pnpm's standalone executable on the Linux and Windows runners, so running it through `node` failed. Run it directly unless it's a JavaScript entry point. The remote cache package also brought esbuild and workerd into the workspace, and a root `pnpm install` without `--ignore-scripts` failed on their unapproved build scripts. Allow them, as the standalone package already does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent fc7767f commit ffec6ed

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎.github/scripts/check-remote-cache-standalone.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { basename, join } from 'node:path';
55

66
const pnpm = process.env.npm_execpath;
77
if (!pnpm) throw new Error('Run this check through pnpm check-remote-cache-standalone');
8+
// pnpm can be a JavaScript entry point or a standalone executable.
9+
const [command, prefix] = /\.[cm]?js$/.test(pnpm) ? [process.execPath, [pnpm]] : [pnpm, []];
810
const directory = await mkdtemp(join(tmpdir(), 'remote-cache-standalone-'));
911
const excluded = new Set([
1012
'node_modules',
@@ -25,7 +27,7 @@ try {
2527
});
2628
for (const args of [['install', '--frozen-lockfile'], ['check'], ['build']]) {
2729
await new Promise((resolve, reject) => {
28-
const child = spawn(process.execPath, [pnpm, ...args], {
30+
const child = spawn(command, [...prefix, ...args], {
2931
cwd: directory,
3032
stdio: 'inherit',
3133
shell: false,

‎pnpm-workspace.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ allowBuilds:
88
'@playwright/browser-chromium': true
99
bun: true
1010
deno: true
11+
esbuild: true
12+
workerd: true
1113

1214
minimumReleaseAgeExclude:
1315
- vite-plus

0 commit comments

Comments
 (0)