From 13e8ea668eb4eb322946c6a665db298b83dfcb59 Mon Sep 17 00:00:00 2001 From: Daniel Gee Date: Fri, 22 May 2026 21:44:36 +0100 Subject: [PATCH 1/2] fix: replace setup-node pnpm cache with explicit actions/cache setup-node@v6 with cache: 'pnpm' fails on cache misses when pnpm is managed by corepack: it computes the store path at setup time (before pnpm install), but the path doesn't yet exist on disk, so the POST step's path-validation check fails and marks the job as failed. Replace with explicit caching: - Remove cache: 'pnpm' from setup-node so it no longer manages pnpm caching itself - Add a 'Get pnpm store directory' step that runs pnpm store path --silent (after corepack has been enabled) to capture the real store path used by the project's pinned pnpm version - Add an explicit actions/cache@v5 step that caches that path, keyed on pnpm-lock.yaml so cache keys stay correct Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0ddd927..85dc3abc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -210,8 +210,19 @@ jobs: uses: actions/setup-node@v6 with: node-version: 22.x - cache: 'pnpm' - cache-dependency-path: ui/menu-website/pnpm-lock.yaml + + - name: Get pnpm store directory + id: pnpm-cache + run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + working-directory: ./ui/menu-website + + - name: Cache pnpm store + uses: actions/cache@v5 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/menu-website/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install frontend dependencies run: pnpm install --frozen-lockfile From 7c2ed5d41953041259298c9ba701d09bc96ea093 Mon Sep 17 00:00:00 2001 From: Daniel Gee Date: Fri, 22 May 2026 21:52:07 +0100 Subject: [PATCH 2/2] fix: move setup-node before corepack enable for deterministic pnpm shims Per Copilot review: running corepack enable pnpm before actions/setup-node is non-deterministic because setup-node prepends its own Node installation to PATH, which can shadow the corepack shims registered by the earlier step. Running setup-node first ensures corepack enable registers pnpm shims against the Node installation that is actually active for the rest of the job. Also extend the pnpm store cache key to include package.json alongside pnpm-lock.yaml, so a packageManager version bump (which only changes package.json, not the lockfile) correctly invalidates the cache. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85dc3abc..32b8ddb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -203,14 +203,14 @@ jobs: path: open-api merge-multiple: true - - name: Enable pnpm with corepack - run: corepack enable pnpm - - name: Use Node.js 22.x uses: actions/setup-node@v6 with: node-version: 22.x + - name: Enable pnpm with corepack + run: corepack enable pnpm + - name: Get pnpm store directory id: pnpm-cache run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" @@ -220,7 +220,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/menu-website/pnpm-lock.yaml') }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/menu-website/pnpm-lock.yaml', 'ui/menu-website/package.json') }} restore-keys: | ${{ runner.os }}-pnpm-store-