fix: improve yarn cache strategy to prevent immutable lockfile errors
- Cache .yarn/cache instead of node_modules to avoid inconsistencies - Include both yarn.lock and package.json in cache key hash - Update restore-keys to be more specific with package.json hash - This prevents CI from using stale caches after dependency updates https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
This commit is contained in:
@@ -38,11 +38,11 @@ jobs:
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
.yarn/cache
|
||||
.yarn/install-state.gz
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
${{ runner.os }}-yarn-${{ hashFiles('package.json') }}-
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user