diff --git a/dist/index.js b/dist/index.js index ddc254e..c9dbaaf 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index b0a2a3c..e9a8495 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -1,5 +1,5 @@ import { addPath, exportVariable } from '@actions/core' -import { spawn } from 'child_process' +import { spawn, spawnSync } from 'child_process' import { rm, writeFile, mkdir, symlink } from 'fs/promises' import { readFileSync, existsSync } from 'fs' import path from 'path' @@ -60,6 +60,15 @@ export async function runSelfInstaller(inputs: Inputs): Promise { ? path.join(dest, 'node_modules', '@pnpm', 'exe', process.platform === 'win32' ? 'pnpm.exe' : 'pnpm') : path.join(dest, 'node_modules', 'pnpm', 'bin', 'pnpm.mjs') + // Verify pnpm is callable + console.log(`Verifying pnpm at: ${bootstrapPnpm}`) + console.log(`File exists: ${existsSync(bootstrapPnpm)}`) + const verify = spawnSync(bootstrapPnpm, ['--version'], { encoding: 'utf8', timeout: 15000 }) + console.log(`pnpm --version stdout: ${JSON.stringify(verify.stdout)}`) + console.log(`pnpm --version stderr: ${JSON.stringify(verify.stderr)}`) + console.log(`pnpm --version status: ${verify.status}`) + if (verify.error) console.log(`pnpm --version error: ${verify.error}`) + // Determine the target version const targetVersion = readTargetVersion({ version, packageJsonFile })