From f71bccf53f60711612a0c574aae311ff18ef5144 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Thu, 14 May 2026 12:07:09 +0200 Subject: [PATCH] ci(.github/actions/setup-node): verify active Node version (#25143) Updates the shared setup-node composite action to current Node 24 based releases of `pnpm/action-setup` and `actions/setup-node`. This avoids the deprecated Node 20 action runtime seen in CODAGT-178 while keeping the third-party actions pinned by SHA. Adds an explicit post-setup check that fails inside Setup Node when `node --version` is not `v22.19.0`, so self-hosted runner/toolcache mismatches are surfaced before `pnpm install` reports a dependency engine error. Closes https://github.com/coder/internal/issues/1457 Generated by Coder Agents. --- .github/actions/setup-node/action.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-node/action.yaml b/.github/actions/setup-node/action.yaml index 4686cbd1f4..0c276f0ab8 100644 --- a/.github/actions/setup-node/action.yaml +++ b/.github/actions/setup-node/action.yaml @@ -11,16 +11,29 @@ runs: using: "composite" steps: - name: Install pnpm - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 + uses: pnpm/action-setup@739bfe42ca9233c5e6aca07c1a25a9d34aca49b0 # v6.0.7 - name: Setup Node - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 22.19.0 # See https://github.com/actions/setup-node#caching-global-packages-data cache: "pnpm" cache-dependency-path: ${{ inputs.directory }}/pnpm-lock.yaml + - name: Verify Node + shell: bash + run: | + set -euo pipefail + + expected="v22.19.0" + actual="$(node --version)" + if [[ "$actual" != "$expected" ]]; then + echo "::error::Expected Node.js $expected, but got $actual from $(command -v node)." + exit 1 + fi + echo "Node.js $actual is active at $(command -v node)." + - name: Install root node_modules shell: bash run: ./scripts/pnpm_install.sh