Skip to content

fix: resolve pnpm version from action package.json via bash#3

Merged
mmanciop merged 1 commit into
mainfrom
fix/pnpm-version-path
Jul 8, 2026
Merged

fix: resolve pnpm version from action package.json via bash#3
mmanciop merged 1 commit into
mainfrom
fix/pnpm-version-path

Conversation

@mmanciop

@mmanciop mmanciop commented Jul 8, 2026

Copy link
Copy Markdown
Member

Second bug caught by the same e2e run

After #2 landed and I re-ran the e2e caller, Set up Node.js succeeded but set up pnpm failed with:

Error: No pnpm version is specified.
Please specify it by one of the following ways:
  - in the GitHub Action config with the key "version"
  - in the package.json with the key "packageManager"
  - in the package.json with the key "devEngines.packageManager"

Same class of bug: pnpm/action-setup's package_json_file input has the same resolution quirk as actions/setup-node's node-version-file. An absolute path from github.action_path gets concatenated with $GITHUB_WORKSPACE, the file isn't found, and the action silently falls back to the caller's package.json (which does not declare a packageManager field).

Fix

Same pattern PR #2 used: a preceding bash step reads the value from the action's own package.json (via ${GITHUB_ACTION_PATH}) into a step output and passes the literal version string to setup-pnpm via version.

Uses node -p because setup-node has just run, so Node is on PATH.

Verification

  • pnpm run lint, format:check, typecheck, test all green (87 engine tests + docs-invariants scaffold).
  • Actual acceptance is the e2e caller run against this branch's SHA post-merge; will report back.

Follow-up thought

Both of these bugs share a root cause — third-party actions with absolute-path resolution quirks. Worth considering an in-repo smoke workflow (.github/workflows/e2e-smoke.yml) that self-invokes the composite via uses: ./ and checks off the "each step's inputs resolve correctly" case on every PR. Not blocking this fix; noted as follow-up in project state.

…ckage_json_file

Same class of bug as #2 (Node version): `pnpm/action-setup`'s
`package_json_file` input is resolved relative to `$GITHUB_WORKSPACE`.
Passing an absolute path from `github.action_path` produces a
non-existent file; the action silently falls back to the caller's
package.json (which does not declare `packageManager`) and fails with:

  Error: No pnpm version is specified.
  Please specify it by one of the following ways:
    - in the GitHub Action config with the key "version"
    - in the package.json with the key "packageManager"
    - in the package.json with the key "devEngines.packageManager"

Caught by the second e2e run against dash0hq/sync-docs-e2e-source
(after PR #2 fixed the analogous node-version-file resolution).

Fix: read the version from the action's package.json in a preceding
bash step (Node is on PATH since setup-node just ran) and pass the
literal version string to setup-pnpm via `version`. Consistent with
the pattern PR #2 established for the Node version.

Local verification: pnpm lint, format:check, typecheck, and the 87
engine tests + docs-invariants scaffold test all green.
@mmanciop mmanciop merged commit 1bb3b75 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant