pnpm / pnpm/action-setup

Documentation foot gun

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
217
Avg merge
8h 42m
Merged PRs (30d)
1

Description

If user wants to use pnpm env ... then the current documentation leads them astray because it yields this $PATH:

/opt/hostedtoolcache/node/22.10.0/x64/bin:/home/runner/setup-pnpm/node_modules/.bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Note that hostedtoolcache precedes the pnpm bin. This means that when pnpm env is used it will not override the static bin in hostedtoolcache.

One way to fix this is change the order contrary to the docs of steps, such that node is setup BEFORE pnpm. But that only works if cache: pnpm is NOT used. 🐔 🥚

It also does not work to run pnpm setup after because it will see that pnpm is in the path (just not before hostedtoolcache) and thus do nothing:

Appended new lines to /home/runner/.bashrc

Next configuration changes were made:
export PNPM_HOME="/home/runner/setup-pnpm/node_modules/.bin"
case ":$PATH:" in
  *":$PNPM_HOME:"*) ;;
  *) export PATH="$PNPM_HOME:$PATH" ;;
esac

Are are solutions that permit pnpm env working AND node setup using cache: pnpm? If so, let's document them. If not, let's mention this caveat.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the current documentation for pnpm env, Node setup, and cache: pnpm, then reproduce the reported PATH ordering in GitHub Actions. Determine whether a configuration supports both pnpm env and Node setup with the cache enabled. Document that solution if one exists; otherwise add the caveat and explain the relevant ordering limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, nodejs, typescript
Domain
ci-cd, devops, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.