fix: pnpm self-update binary shadowed by bootstrap on PATH (#230)
Test Action / Test with default inputs (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with default inputs (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with dest (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with standalone (ubuntu-latest) (push) Has been cancelled
Test Action / Test with standalone (windows-latest) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (macos-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (ubuntu-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, 9.15.5) (push) Has been cancelled
Test Action / Test with devEngines.packageManager (windows-latest, >=9.15.0) (push) Has been cancelled
Test Action / Test with run_install (global, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (null, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (global, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (null, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (global, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (null, windows-latest) (push) Has been cancelled

Problem
pnpm self-update installs the target version to PNPM_HOME/bin/pnpm, but the bootstrap binary at PNPM_HOME/pnpm has higher PATH precedence because addPath(pnpmHome) was called after addPath(pnpmHome/bin). @actions/core's addPath prepends, so the later call wins — the bootstrap version shadows the self-updated binary.

Fix
Swap the addPath call order so PNPM_HOME/bin (where self-update puts the target binary) has higher PATH precedence. The bootstrap pnpm is invoked via absolute path, so this doesn't affect the bootstrap step.
This commit is contained in:
oniani1
2026-04-18 17:00:23 +04:00
committed by GitHub
parent 078e9d4164
commit 71c92474e7
2 changed files with 155 additions and 154 deletions
+149 -150
View File
File diff suppressed because one or more lines are too long