Skip to content

Commit b510ced

Browse files
committed
fix: add cache-key
1 parent 3621797 commit b510ced

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Lockas custom locka/setup-node command which uses corepack and pnpm to do quick
88
- uses: locka/setup-node@v1
99
with:
1010
node-version: '20'
11+
cache-key: '1'
1112
```

action.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ inputs:
55
node-version:
66
description: 'Version Spec of the version to use. Examples: 20.x, 20.4.0, >=20.0.0'
77
default: '20'
8+
cache-key:
9+
description: 'A key to use for the cache. sometimes you need to bust the cache'
10+
default: '1'
811

912
runs:
1013
using: 'composite'
@@ -32,8 +35,8 @@ runs:
3235
~/.cache
3336
!~/cache/exclude
3437
!~/.cache/exclude
35-
key: ${{ runner.os }}-node20-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36-
restore-keys: ${{ runner.os }}-node20-pnpm-store-
38+
key: ${{ runner.os }}-${{ inputs.node-version }}-${{ inputs.cache-key }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: ${{ runner.os }}-${{ inputs.node-version }}-${{ inputs.cache-key }}-pnpm-
3740

3841
- name: Install dependencies
3942
shell: bash

0 commit comments

Comments
 (0)