From 4e12461ae7cb406a1fdc1de6b45c6e45f49ca1f2 Mon Sep 17 00:00:00 2001 From: Michele Mancioppi Date: Wed, 8 Jul 2026 13:10:46 +0200 Subject: [PATCH] fix: resolve Node version from action's .nvmrc via bash, not node-version-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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///home/runner/work/_actions/dash0hq/sync-docs-action//.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. --- action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 131fe23..ee92cec 100644 --- a/action.yml +++ b/action.yml @@ -67,10 +67,18 @@ inputs: runs: using: composite steps: + - name: Read required Node.js version from the action's .nvmrc + id: node-version + shell: bash + # `actions/setup-node`'s `node-version-file` input is resolved relative to `$GITHUB_WORKSPACE`, + # so an absolute path from `github.action_path` gets concatenated with the workspace prefix and + # fails to resolve. Read the value here and pass it as a literal `node-version` instead. + run: echo "version=$(cat "${GITHUB_ACTION_PATH}/.nvmrc")" >> "$GITHUB_OUTPUT" + - name: set up Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version-file: ${{ github.action_path }}/.nvmrc + node-version: ${{ steps.node-version.outputs.version }} - name: set up pnpm uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d # v6.0.5