The best way to control Claude Code, Codex and more from any computer or phone
ci: setup survives npm registry outages (#23582)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 22, 2026 at 05:06 UTC
ed3f965e0768f9a77729a17c5145a90ff3ab6210
1 file changed
+19
-3
.github/actions/setup-ci-deps/action.yml
+19
-3
@@ -3,22 +3,38 @@ description: Install Vite+ and the workspace dependencies from cache.
3
runs:
4
using: composite
5
steps:
6
- # setup-vp reuses an installed exact version, so restoring its home skips the
7
- # installer download on every job.
6
+ # ~/.vite-plus holds vp, the Node.js runtime, and pnpm. A cache entry never
7
+ # updates, so the key names all three versions; otherwise a pnpm or Node.js
8
+ # bump makes every job download them from npm again.
9
- name: Resolve Vite+ version
10
id: vp
11
shell: bash
12
run: |
13
echo "version=$(sed -nE 's/^ vite-plus: ([0-9][^ ]*)$/\1/p' pnpm-workspace.yaml)" >> "$GITHUB_OUTPUT"
14
+ echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
15
+ echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
16
17
- name: Cache Vite+
18
+ id: vp_cache
19
if: steps.vp.outputs.version != ''
20
uses: actions/cache@v6
21
with:
22
path: ~/.vite-plus
19
- key: vite-plus-home-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}
23
+ key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
24
+
25
+ # setup-vp always runs the installer, which fetches vp from npm even when
26
+ # this exact version is installed. A cache hit already has everything, so
27
+ # skip setup-vp and do its remaining work here. This keeps npm outages from
28
+ # failing jobs.
29
+ - name: Use cached Vite+
30
+ if: steps.vp_cache.outputs.cache-hit == 'true'
31
+ shell: bash
32
+ run: |
33
+ echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
34
+ "$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
35
36
- name: Setup Vite+
37
+ if: steps.vp_cache.outputs.cache-hit != 'true'
38
uses: voidzero-dev/setup-vp@v1
39
with:
40
node-version-file: package.json