mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
feat: add path_to_claude_code_executable input for custom Claude Code… (#480)
* feat: add path_to_claude_code_executable input for custom Claude Code installations Adds optional input to specify a custom Claude Code executable path, bypassing automatic installation. This enables: - Using pre-installed Claude Code binaries - Testing with specific versions for debugging - Custom installation paths in unique environments Includes warning that older versions may cause compatibility issues with new features. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * test: add workflow to test custom Claude Code executable path Adds test workflow that: - Manually installs Claude Code via install script - Uses the new path_to_claude_code_executable input - Verifies the custom executable path works correctly - Validates output and execution success 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,8 @@ async function run() {
|
||||
claudeEnv: process.env.INPUT_CLAUDE_ENV,
|
||||
fallbackModel: process.env.INPUT_FALLBACK_MODEL,
|
||||
model: process.env.ANTHROPIC_MODEL,
|
||||
pathToClaudeCodeExecutable:
|
||||
process.env.INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE,
|
||||
});
|
||||
} catch (error) {
|
||||
core.setFailed(`Action failed with error: ${error}`);
|
||||
|
||||
@@ -22,6 +22,7 @@ export type ClaudeOptions = {
|
||||
fallbackModel?: string;
|
||||
timeoutMinutes?: string;
|
||||
model?: string;
|
||||
pathToClaudeCodeExecutable?: string;
|
||||
};
|
||||
|
||||
type PreparedConfig = {
|
||||
@@ -168,7 +169,10 @@ export async function runClaude(promptPath: string, options: ClaudeOptions) {
|
||||
pipeStream.destroy();
|
||||
});
|
||||
|
||||
const claudeProcess = spawn("claude", config.claudeArgs, {
|
||||
// Use custom executable path if provided, otherwise default to "claude"
|
||||
const claudeExecutable = options.pathToClaudeCodeExecutable || "claude";
|
||||
|
||||
const claudeProcess = spawn(claudeExecutable, config.claudeArgs, {
|
||||
stdio: ["pipe", "pipe", "inherit"],
|
||||
env: {
|
||||
...process.env,
|
||||
|
||||
Reference in New Issue
Block a user