1- name : Reproduce Cache 422 Error
1+ name : PNPM Cache 422 Repro
22
33on :
44 workflow_call :
55
66jobs :
7- cache -422-repro :
8- runs-on : ubuntu-latest
7+ repro -422 :
8+ runs-on : self-hosted
99
1010 steps :
1111 - uses : actions/checkout@v4
@@ -18,23 +18,34 @@ jobs:
1818 - name : Install PNPM
1919 run : npm install -g pnpm
2020
21+ - name : Show PNPM store path A
22+ id : cache-path-A
23+ run : |
24+ mkdir -p /tmp/pnpm-store-A
25+ echo "dummy content A" > /tmp/pnpm-store-A/cache.txt
26+ echo "STORE_PATH=/tmp/pnpm-store-A" >> $GITHUB_ENV
27+
2128 - name : Restore PNPM cache (Path A)
2229 uses : actions/cache@v4
2330 with :
24- path : /tmp/pnpm-store-path-A
31+ path : ${{ env.STORE_PATH }}
2532 key : pnpm-store-Linux-18.20.4-v1
2633
27- - name : Show restored files
28- run : ls -la /tmp/pnpm-store-path-A || echo "No cache restored"
34+ - name : Save PNPM cache (Path A)
35+ uses : actions/cache@v4
36+ with :
37+ path : ${{ env.STORE_PATH }}
38+ key : pnpm-store-Linux-18.20.4-v1
2939
30- - name : Prepare different cache content in Path B
40+ - name : Show PNPM store path B
41+ id : cache-path-B
3142 run : |
32- mkdir -p /tmp/pnpm-store-path- B
33- echo "different dummy cache content" > /tmp/pnpm-store-path -B/cache.txt
34- ls -la /tmp/pnpm-store-path-B
43+ mkdir -p /tmp/pnpm-store-B
44+ echo "dummy content B " > /tmp/pnpm-store-B/cache.txt
45+ echo "STORE_PATH= /tmp/pnpm-store-B" >> $GITHUB_ENV
3546
36- - name : Save PNPM cache (Path B)
47+ - name : Save PNPM cache (Path B) - conflict expected
3748 uses : actions/cache@v4
3849 with :
39- path : /tmp/pnpm-store-path-B
50+ path : ${{ env.STORE_PATH }}
4051 key : pnpm-store-Linux-18.20.4-v1
0 commit comments