fix: append (not prepend) action node dir to PATH for npm bootstrap

#239 prepended `dirname(process.execPath)` to PATH so npm's
`#!/usr/bin/env node` shebang resolves on GHE self-hosted runners
where node isn't on PATH. But on runners with a prior `setup-node`
step, this shadowed the user's installed toolchain with the
runner-bundled node (e.g. externals/node24/bin), pairing the user's
npm with a mismatched node — or picking up a broken `npm` shipped
next to the runner-bundled node.

Append instead so a user-installed toolchain on PATH keeps
precedence; the runner's node dir remains as a fallback for the
original #234 case where node isn't on PATH at all.

Fixes #240
This commit is contained in:
Zoltan Kochan
2026-05-02 10:48:15 +02:00
parent 26f6d4f2c5
commit c3e11127ab
2 changed files with 10 additions and 6 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long