From d5645f2e4c3bf07d198e57177403226f932c18ee Mon Sep 17 00:00:00 2001 From: "privilegedescalation-engineer[bot]" <269729446+privilegedescalation-engineer[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 01:56:20 +0000 Subject: [PATCH] fix: reorder Setup Node before pnpm setup in plugin-release workflow (#83) Corepack requires Node to be set up first. The release job was failing with 'corepack: command not found' because Setup pnpm (Corepack) ran before Setup Node. This aligns plugin-release.yaml with plugin-ci.yaml step ordering. Fixes PRI-21 Co-authored-by: Pawla Abdul (Bot) --- .github/workflows/plugin-release.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugin-release.yaml b/.github/workflows/plugin-release.yaml index f133766..9aac349 100644 --- a/.github/workflows/plugin-release.yaml +++ b/.github/workflows/plugin-release.yaml @@ -115,6 +115,14 @@ jobs: echo "has_package_manager=false" >> $GITHUB_OUTPUT fi + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: ${{ inputs.node-version }} + # Only enable built-in npm caching here; pnpm caching is handled below + # after pnpm is installed (corepack is not available before setup-node). + cache: ${{ steps.pkg-manager.outputs.manager == 'npm' && 'npm' || '' }} + - name: Setup pnpm (via Corepack, reads version from packageManager field) if: steps.pkg-manager.outputs.manager == 'pnpm' && steps.pkg-manager.outputs.has_package_manager == 'true' run: | @@ -129,11 +137,19 @@ jobs: run_install: false version: latest - - name: Setup Node - uses: actions/setup-node@v6 + - name: Get pnpm store directory + id: pnpm-store + if: steps.pkg-manager.outputs.manager == 'pnpm' + run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + + - name: Cache pnpm store + if: steps.pkg-manager.outputs.manager == 'pnpm' + uses: actions/cache@v5 with: - node-version: ${{ inputs.node-version }} - cache: ${{ steps.pkg-manager.outputs.manager }} + path: ${{ steps.pnpm-store.outputs.dir }} + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- - name: Configure Git run: |