|
1 |
| -name: PNPM Cache Example - Try 422 |
| 1 | +name: Reproduce Cache 422 Error |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - workflow_call: |
| 4 | + workflow_dispatch: |
5 | 5 |
|
6 | 6 | jobs:
|
7 |
| - install: |
8 |
| - runs-on: self-hosted |
| 7 | + cache-422-repro: |
| 8 | + runs-on: self-hosted # or your self-hosted runner on Azure |
9 | 9 |
|
10 | 10 | steps:
|
11 |
| - - uses: actions/checkout@v4 |
12 |
| - |
13 |
| - - name: Setup Node.js |
14 |
| - uses: actions/setup-node@v4 |
15 |
| - with: |
16 |
| - node-version: 18.20.4 |
17 |
| - |
18 |
| - - name: Install PNPM |
19 |
| - run: npm install -g pnpm |
20 |
| - |
21 |
| - - name: Set store path dynamically (simulate path differences) |
22 |
| - id: set_path |
23 |
| - run: | |
24 |
| - # Example: path depends on env or runner user (simulate mismatch) |
25 |
| - if [[ "$(hostname)" == "my-azure-runner" ]]; then |
26 |
| - echo "store_path=/home/azureuser/.local/share/pnpm/store/v10" >> $GITHUB_OUTPUT |
27 |
| - else |
28 |
| - echo "store_path=/home/ec2-user/_work/_tool/node/18.20.4/x64" >> $GITHUB_OUTPUT |
29 |
| - fi |
30 |
| -
|
31 |
| - - name: Restore PNPM cache |
32 |
| - uses: actions/cache@v4 |
33 |
| - with: |
34 |
| - path: ${{ steps.set_path.outputs.store_path }} |
35 |
| - key: pnpm-store-Linux-18.20.4-v1 |
36 |
| - |
37 |
| - - name: Install dependencies |
38 |
| - run: pnpm install |
39 |
| - |
40 |
| - - name: Save PNPM cache |
41 |
| - uses: actions/cache@v4 |
42 |
| - with: |
43 |
| - path: ${{ steps.set_path.outputs.store_path }} |
44 |
| - key: pnpm-store-Linux-18.20.4-v1 |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + |
| 13 | + - name: Setup Node.js |
| 14 | + uses: actions/setup-node@v4 |
| 15 | + with: |
| 16 | + node-version: 18.20.4 |
| 17 | + |
| 18 | + - name: Install PNPM |
| 19 | + run: npm install -g pnpm |
| 20 | + |
| 21 | + - name: Restore PNPM cache (Path A) |
| 22 | + uses: actions/cache@v4 |
| 23 | + with: |
| 24 | + path: /tmp/pnpm-store-path-A |
| 25 | + key: pnpm-store-Linux-18.20.4-v1 |
| 26 | + |
| 27 | + - name: Create dummy file in Path A |
| 28 | + run: | |
| 29 | + mkdir -p /tmp/pnpm-store-path-A |
| 30 | + echo "dummy cache content" > /tmp/pnpm-store-path-A/cache.txt |
| 31 | +
|
| 32 | + - name: Save PNPM cache (Path B - different from restore) |
| 33 | + uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + path: /tmp/pnpm-store-path-B |
| 36 | + key: pnpm-store-Linux-18.20.4-v1 |
0 commit comments