Skip to content

Commit b5d22c1

Browse files
Fall back to the pure-node CLI so check 19 degrades to a visible skip
The native package resolves as an optional dependency and did not arrive on the runner, so asserting `claude --version` turned a missing optional download into a red build over something this repo does not control. The package ships a documented pure-node fallback for this case. Use it when the native binary is absent, and report rather than fail if even that is unavailable: check 19 runs its own two-way control and skips with a reason when the validator cannot be trusted, so the gate output says plainly that the manifests went unvalidated on this run instead of implying they passed.
1 parent ce1d7c7 commit b5d22c1

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/verify.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,20 @@ jobs:
3030
# later as a check that silently measures nothing.
3131
- name: Install Claude Code CLI
3232
run: |
33-
npm install -g @anthropic-ai/claude-code
34-
node "$(npm root -g)/@anthropic-ai/claude-code/install.cjs" || true
35-
claude --version
33+
npm install -g @anthropic-ai/claude-code || true
34+
root="$(npm root -g)/@anthropic-ai/claude-code"
35+
node "$root/install.cjs" || true
36+
# The native package resolves as an optional dependency and does not always arrive on
37+
# a runner. The package ships a documented pure-node fallback for exactly this, so
38+
# prefer it over failing the job: put a shim ahead of the shim.
39+
if ! claude --version >/dev/null 2>&1 && [ -f "$root/cli-wrapper.cjs" ]; then
40+
printf '#!/bin/sh\nexec node "%s/cli-wrapper.cjs" "$@"\n' "$root" | sudo tee /usr/local/bin/claude >/dev/null
41+
sudo chmod +x /usr/local/bin/claude
42+
fi
43+
# Report, do not fail. Check 19 runs its own control and skips with a reason when the
44+
# validator is unusable, so an unavailable CLI degrades to a visible skip in the gate
45+
# output rather than a red run over something this repo does not control.
46+
claude --version || echo "::warning::claude CLI unusable on this runner; check 19 will skip"
3647
3748
- name: Run the verification gate
3849
run: ./.claude/verify.sh

0 commit comments

Comments
 (0)