fix: resolve Node version from action .nvmrc via bash#2
Merged
Conversation
…sion-file
The `actions/setup-node` action's `node-version-file` input is resolved
relative to `$GITHUB_WORKSPACE`, not to `github.action_path`. Passing an
absolute path derived from `github.action_path` produced a concatenated
path like
/home/runner/work/<caller>/<caller>/home/runner/work/_actions/dash0hq/sync-docs-action/<sha>/.nvmrc
which never resolves. First real e2e run against a caller repo (throwaway
`dash0hq/sync-docs-e2e-source`) failed immediately at this step.
Fix: read the version out of the action's `.nvmrc` in a preceding bash
step (which can dereference `${GITHUB_ACTION_PATH}` correctly) and pass
the literal version string to setup-node via `node-version`. Keeps the
`.nvmrc` in this repo as the single source of truth for the Node
version — devs bump one file, the composite action follows.
mmanciop
added a commit
that referenced
this pull request
Jul 8, 2026
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug caught by the first live e2e run
Ran the composite action from a throwaway caller (
dash0hq/sync-docs-e2e-source), it failed at the first step:Cause:
actions/setup-node'snode-version-fileinput is resolved relative to$GITHUB_WORKSPACE, not togithub.action_path. The absolute path returned bygithub.action_pathgot concatenated with the workspace prefix and produced the gibberish path above.Fix
Introduce a small
bashstep that reads the version from the action's own.nvmrc(via${GITHUB_ACTION_PATH}) into a step output, then pass the literal version string toactions/setup-nodevianode-version..nvmrcremains the single source of truth for the Node version required by the engine.Diff is tiny — one new step, one changed line on the existing setup-node step.
Verification
pnpm run lint,format:check,typecheck,test— all still green (87 engine tests + 1 docs-invariants scaffold).dash0hq/sync-docs-action@<this-branch-sha>is the actual acceptance test; will confirm once merged.Follow-up
Once this merges, I'll update the caller pin on
dash0hq/sync-docs-e2e-sourceto the new head-of-main SHA, re-run the e2e workflow, and confirm the whole pipeline runs cleanly against a real caller.