From ef7613c52685f187fddd305beaa319ece6c94eed Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Mon, 13 Apr 2026 00:17:17 -0700 Subject: [PATCH] fix: use corepack pnpm on node 18 --- .github/workflows/ci.yml | 12 +++++++++--- .github/workflows/reusable-test.yml | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7bd4cf2..35a6badf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,18 @@ jobs: # Package manager setup - name: Setup pnpm - if: matrix.pm == 'pnpm' + if: matrix.pm == 'pnpm' && matrix.node != '18.x' uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6.0.0 with: # Keep an explicit pnpm major because this repo's packageManager is Yarn. - # pnpm 10's self-installer requires newer Node runtime features than Node 18 provides. - version: ${{ matrix.node == '18.x' && '9' || '10' }} + version: 10 + + - name: Setup pnpm (via Corepack) + if: matrix.pm == 'pnpm' && matrix.node == '18.x' + shell: bash + run: | + corepack enable + corepack prepare pnpm@9 --activate - name: Setup Yarn (via Corepack) if: matrix.pm == 'yarn' diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 69c3cbc7..04b7dc95 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -35,12 +35,18 @@ jobs: node-version: ${{ inputs.node-version }} - name: Setup pnpm - if: inputs.package-manager == 'pnpm' + if: inputs.package-manager == 'pnpm' && inputs.node-version != '18.x' uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6.0.0 with: # Keep an explicit pnpm major because this repo's packageManager is Yarn. - # pnpm 10's self-installer requires newer Node runtime features than Node 18 provides. - version: ${{ inputs.node-version == '18.x' && '9' || '10' }} + version: 10 + + - name: Setup pnpm (via Corepack) + if: inputs.package-manager == 'pnpm' && inputs.node-version == '18.x' + shell: bash + run: | + corepack enable + corepack prepare pnpm@9 --activate - name: Setup Yarn (via Corepack) if: inputs.package-manager == 'yarn'