diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index c79905f..f2e7345 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -1,3 +1,4 @@ +import * as core from '@actions/core' import { spawn } from 'child_process' import { execPath } from 'process' import { join } from 'path' @@ -22,10 +23,14 @@ export async function runSelfInstaller(inputs: Inputs): Promise { const response = await fetch('https://pnpm.js.org/pnpm.js') response.body.pipe(cp.stdin) - return new Promise((resolve, reject) => { + const result = await new Promise((resolve, reject) => { cp.on('error', reject) cp.on('close', resolve) }) + if (result === 0) { + core.addPath(join(dest, 'node_modules/.bin')) + } + return result } export default runSelfInstaller