5
0
mirror of https://github.com/pnpm/action-setup.git synced 2026-05-08 01:48:28 +00:00

test(ci): pass bin_dest via env to survive Windows backslashes

Direct GitHub-expression interpolation of `${{ steps.pnpm.outputs.bin_dest }}`
into the bash script let bash eat the backslashes in the Windows path
(`C:Usersrunneradminsetup-pnpmnode_modules.binbin/pnpm`), failing with
"No such file or directory". Forward the value via env so the path
reaches bash unmangled.
This commit is contained in:
Zoltan Kochan
2026-05-07 08:59:18 +02:00
parent 624e28f5d0
commit 01da663869

View File

@@ -195,12 +195,16 @@ jobs:
version: ${{ matrix.version }}
- name: 'Test: bin_dest/pnpm reports requested version'
# Pass paths via env, not template interpolation, so Windows
# backslashes in `bin_dest` aren't eaten by bash's escape handling.
env:
BIN_DEST: ${{ steps.pnpm.outputs.bin_dest }}
REQUIRED: ${{ matrix.version }}
run: |
required='${{ matrix.version }}'
actual="$(${{ steps.pnpm.outputs.bin_dest }}/pnpm --version)"
actual="$("$BIN_DEST/pnpm" --version)"
echo "pnpm version via bin_dest: ${actual}"
if [ "${actual}" != "${required}" ]; then
echo "Expected pnpm version ${required}, but got ${actual}"
if [ "${actual}" != "${REQUIRED}" ]; then
echo "Expected pnpm version ${REQUIRED}, but got ${actual}"
exit 1
fi
shell: bash