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