From 35acbf6e62e73b136fc2f4ba6128f607450657c7 Mon Sep 17 00:00:00 2001 From: Brendan Ryan Date: Mon, 19 Jan 2026 09:25:19 -0800 Subject: [PATCH] fix: revert to manual caching to fix composite action path resolution The setup-node@v4 built-in caching doesn't support github.action_path in cache-dependency-path, causing 'paths were not resolved' errors. This reverts to explicit actions/cache@v4 steps that properly handle caching in composite actions by: - Manually hashing the lockfile for cache keys - Caching both pnpm store and node_modules - Conditionally installing only on cache miss Fixes the caching failure that prevented the action from running. --- action.yml | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index b0fb288..bb9b8e6 100644 --- a/action.yml +++ b/action.yml @@ -43,18 +43,42 @@ outputs: runs: using: "composite" steps: - - name: Enable Corepack - shell: bash - run: corepack enable + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - cache: "pnpm" - cache-dependency-path: ${{ github.action_path }}/pnpm-lock.yaml + + - name: Get cache keys + id: cache-keys + shell: bash + run: | + echo "PNPM_STORE=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + # Hash the lockfile for cache key + LOCK_HASH=$(sha256sum "${{ github.action_path }}/pnpm-lock.yaml" | cut -d' ' -f1 | head -c 16) + echo "LOCK_HASH=$LOCK_HASH" >> $GITHUB_OUTPUT + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.cache-keys.outputs.PNPM_STORE }} + key: tempo-lints-pnpm-store-${{ runner.os }}-${{ steps.cache-keys.outputs.LOCK_HASH }} + restore-keys: | + tempo-lints-pnpm-store-${{ runner.os }}- + + - name: Cache node_modules (includes sg binary) + id: cache-node-modules + uses: actions/cache@v4 + with: + path: ${{ github.action_path }}/node_modules + key: tempo-lints-node-modules-${{ runner.os }}-${{ steps.cache-keys.outputs.LOCK_HASH }} - name: Install tempo-lints dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' shell: bash run: cd "${{ github.action_path }}" && pnpm install --frozen-lockfile