1
- name : PNPM Cache Example
1
+ name : PNPM Cache Example - Force 422
2
2
3
3
on :
4
4
workflow_call :
5
5
6
6
jobs :
7
7
install :
8
- runs-on : ubuntu-latest
8
+ runs-on : self-hosted
9
9
10
10
steps :
11
11
- uses : actions/checkout@v4
@@ -18,23 +18,23 @@ jobs:
18
18
- name : Install PNPM
19
19
run : npm install -g pnpm
20
20
21
- - name : Get PNPM store path or fallback
22
- id : pnpm -path
21
+ - name : Set invalid cache path
22
+ id : invalid -path
23
23
run : |
24
- PNPM_STORE_PATH=$(pnpm store path 2>/dev/null || echo "/tmp/fake-pnpm-store-path")
25
- echo "store_path=$PNPM_STORE_PATH " >> $GITHUB_OUTPUT
24
+ # Setting a path that likely doesn't exist or isn't accessible to cause failure
25
+ echo "store_path=/nonexistent/path/for/cache " >> $GITHUB_OUTPUT
26
26
27
- - name : Restore PNPM cache
27
+ - name : Restore PNPM cache with invalid path
28
28
uses : actions/cache@v4
29
29
with :
30
- path : ${{ steps.pnpm -path.outputs.store_path }}
31
- key : pnpm-store-${{ runner.os }}-18.20.4-v1
30
+ path : ${{ steps.invalid -path.outputs.store_path }}
31
+ key : pnpm-store-invalid-key-!@# # invalid characters to simulate error
32
32
33
33
- name : Install dependencies
34
- run : pnpm install || echo "Skipping install if pnpm not working "
34
+ run : pnpm install || echo "pnpm install failed as expected "
35
35
36
- - name : Save PNPM cache
36
+ - name : Save PNPM cache with invalid path
37
37
uses : actions/cache@v4
38
38
with :
39
- path : ${{ steps.pnpm -path.outputs.store_path }}
40
- key : pnpm-store-${{ runner.os }}-18.20.4-v1
39
+ path : ${{ steps.invalid -path.outputs.store_path }}
40
+ key : pnpm-store-invalid-key-!@#
0 commit comments