name: "Setup Node" description: "Sets up the correct Node version and installs pnpm" inputs: lockfile-dir: description: "Path to the pnpm-lock.yaml file" required: true npmjs-token: description: "NPMJS token to use for authentication" required: true node-version: description: "Version of nodejs to install" required: false default: "22" runs: using: "composite" steps: - name: Configure npm auth shell: bash run: | if [[ -z "${{ inputs.npmjs-token }}" ]]; then echo "inputs.npmjs-token not provided" >&2 exit 1 fi cat > "$HOME/.npmrc" <<'RC' always-auth=true //registry.npmjs.org/:_authToken=${{ inputs.npmjs-token }} RC - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 with: version: latest - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: node-version: ${{ inputs.node-version }} cache: pnpm cache-dependency-path: ${{ inputs.lockfile-dir }}