Skip to content

fix(action): install Claude Code only for Claude runtime#334

Merged
dcramer merged 2 commits into
getsentry:mainfrom
tmustier:tmustier/conditional-claude-install
May 19, 2026
Merged

fix(action): install Claude Code only for Claude runtime#334
dcramer merged 2 commits into
getsentry:mainfrom
tmustier:tmustier/conditional-claude-install

Conversation

@tmustier
Copy link
Copy Markdown
Contributor

Companion PR to issue #333
See writeup and evidence in the issue. I am more than happy to amend in particular to generalise, just let me know if you don't like implementation

Pi writeup below:

Summary

  • Move Claude Code setup out of the composite action's unconditional pre-step and into the JS runtime setup path, after matched triggers have been resolved.
  • This keeps the fix small: Claude Code is installed/found only when a matched trigger uses runtime = "claude"; Pi runtime runs skip Claude Code setup.

Detail

  • Changes:
    • Remove the unconditional Claude Code install step from action.yml
    • Add a small action-layer runtime setup helper after matched triggers are resolved
    • Skip Claude Code setup for runtime = "pi"
    • For runtime = "claude", validate auth and install/find Claude Code on demand using the current install script/version/retry behaviour
  • Context: see GitHub Action installs Claude Code even when resolved runtime is Pi #333 for the detailed motivation and evidence. In short, Pi-only action runs currently install Claude Code even though the Pi runtime does not use it, which is confusing and adds avoidable CI time.
  • Tests
    • pnpm vitest run src/action/workflow/base.test.ts src/action/workflow/pr-workflow.test.ts src/action/workflow/schedule.test.ts src/action/triggers/executor.test.ts
    • pnpm typecheck
    • pnpm lint
    • pnpm build
    • End-to-end smoke test in a dummy repo: https://github.com/tmustier/warden-test/actions/runs/26031290149
      • Pi runtime invoked the model and asserted Claude Code was not installed
      • Claude runtime installed Claude Code, invoked the model, and asserted the executable exists

@dcramer
Copy link
Copy Markdown
Member

dcramer commented May 18, 2026

Thanks! Totally missed this with the recent Pi changes. Will get a couple minor cleanups in and land this

Add the required exported-function JSDoc for the new runtime setup helper.

Co-Authored-By: GPT-5 Codex <noreply@anthropic.com>
@dcramer dcramer merged commit 8349a3a into getsentry:main May 19, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants