Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pnpm/action-setup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.3
Choose a base ref
...
head repository: pnpm/action-setup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.4
Choose a head ref
  • 1 commit
  • 2 files changed
  • 2 contributors

Commits on Apr 30, 2026

  1. fix: use npm co-located with the action node binary (#239)

    * fix: use npm co-located with the action node binary
    
    * fix: resolve npm by absolute path; guard against unset PATH
    
    Follow-up to 5a9e198. Two refinements to the GHE self-hosted runner fix:
    
    - Spawn npm via `path.join(dirname(process.execPath), 'npm[.cmd]')`
      instead of relying on PATH lookup. This matches the original PR
      description and is robust against PATH-shadowed npm installations.
    - Avoid `"<dir>:undefined"` leaking into PATH when `process.env.PATH`
      is unset (rare, but possible in stripped environments).
    
    PATH still has the node directory prepended so npm's
    `#!/usr/bin/env node` shebang can resolve node on Linux/macOS.
    
    * fix: revert npm to PATH lookup; runner externals lacks npm
    
    Revert 42e75a1's switch to absolute-path npm resolution. The premise
    that npm is co-located with the action's node binary is false on
    GitHub-hosted runners: `process.execPath` points into
    `runner/externals/node24/bin/`, which contains node only — not npm.
    The absolute-path spawn produced ENOENT on Linux/macOS and
    "not recognized" on Windows.
    
    Go back to spawning `'npm'` and relying on PATH lookup, which works
    on standard runners (npm is on PATH from the runner image) and on
    the GHE self-hosted setup that motivated the original fix. Keep the
    node-directory prepend so npm's `#!/usr/bin/env node` shebang
    resolves, and keep the unset-PATH guard.
    
    ---------
    
    Co-authored-by: Zoltan Kochan <[email protected]>
    benquarmby and zkochan authored Apr 30, 2026
    Configuration menu
    Copy the full SHA
    26f6d4f View commit details
    Browse the repository at this point in the history
Loading