diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 94bd743..a1757c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -51,12 +51,17 @@ jobs: uses: actions/setup-node@v6 with: node-version: 22 - check-latest: true cache: npm + # Corepack avoids `npm install -g npm` when the bundled global npm is broken (e.g. missing promise-retry). - name: Upgrade npm for trusted publishing (OIDC) if: steps.gate.outputs.publish == 'true' - run: npm install -g npm@">=11.5.1" + env: + COREPACK_ENABLE_DOWNLOAD_PROMPT: 0 + run: | + corepack enable + corepack prepare npm@11.5.1 --activate + npm --version - name: Ensure versions match if: steps.gate.outputs.publish == 'true'