mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-08-21 19:08:57 +08:00
fix: pass install.sh binary path explicitly to Agent SDK (#1235)
Agent SDK 0.2.113 dropped vendor/ripgrep and now ships native binaries via per-platform optionalDependencies. Two breakages: - action.yml chmod'd vendor/ripgrep which no longer exists, failing the Install Dependencies step with find exit 1. - The SDK auto-resolves its bundled binary by trying the -musl platform package before the glibc one. bun install does not respect the package.json libc field and installs both on glibc Linux, so the SDK picks the musl binary and spawn fails with ENOENT. Remove the obsolete ripgrep chmod. Make installClaudeCode() return the install.sh binary path and pass it explicitly as pathToClaudeCodeExecutable so the SDK skips auto-resolution entirely.
This commit is contained in:
@@ -11,6 +11,14 @@ async function run() {
|
||||
try {
|
||||
validateEnvironmentVariables();
|
||||
|
||||
// The composite action's "Install Claude Code" step writes the binary to
|
||||
// ~/.local/bin/claude. Pass that path explicitly so the Agent SDK doesn't
|
||||
// fall back to its bundled platform package, which bun may resolve to the
|
||||
// wrong libc variant on Linux.
|
||||
const claudeExecutable =
|
||||
process.env.INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE ||
|
||||
`${process.env.HOME}/.local/bin/claude`;
|
||||
|
||||
await setupClaudeCodeSettings(
|
||||
process.env.INPUT_SETTINGS,
|
||||
undefined, // homeDir
|
||||
@@ -20,7 +28,7 @@ async function run() {
|
||||
await installPlugins(
|
||||
process.env.INPUT_PLUGIN_MARKETPLACES,
|
||||
process.env.INPUT_PLUGINS,
|
||||
process.env.INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE,
|
||||
claudeExecutable,
|
||||
);
|
||||
|
||||
const promptConfig = await preparePrompt({
|
||||
@@ -38,8 +46,7 @@ async function run() {
|
||||
appendSystemPrompt: process.env.INPUT_APPEND_SYSTEM_PROMPT,
|
||||
fallbackModel: process.env.INPUT_FALLBACK_MODEL,
|
||||
model: process.env.ANTHROPIC_MODEL,
|
||||
pathToClaudeCodeExecutable:
|
||||
process.env.INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE,
|
||||
pathToClaudeCodeExecutable: claudeExecutable,
|
||||
showFullOutput: process.env.INPUT_SHOW_FULL_OUTPUT,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user