mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 23:14:13 +08:00
- Remove all backward compatibility for v1.0 simplification - Remove 10 legacy inputs from base-action/action.yml - Remove 9 legacy inputs from main action.yml - Simplify ClaudeOptions type to just timeoutMinutes and claudeArgs - Remove all legacy option handling from prepareRunConfig - Update tests to remove references to deleted fields - Remove obsolete test file github/context.test.ts - Clean up types to remove customInstructions, allowedTools, disallowedTools Users now use claudeArgs exclusively for CLI control.
38 lines
1015 B
TypeScript
38 lines
1015 B
TypeScript
#!/usr/bin/env bun
|
|
|
|
import * as core from "@actions/core";
|
|
import { preparePrompt } from "./prepare-prompt";
|
|
import { runClaude } from "./run-claude";
|
|
import { setupClaudeCodeSettings } from "./setup-claude-code-settings";
|
|
import { validateEnvironmentVariables } from "./validate-env";
|
|
|
|
async function run() {
|
|
try {
|
|
validateEnvironmentVariables();
|
|
|
|
await setupClaudeCodeSettings(
|
|
process.env.INPUT_SETTINGS,
|
|
undefined, // homeDir
|
|
process.env.INPUT_EXPERIMENTAL_SLASH_COMMANDS_DIR,
|
|
);
|
|
|
|
const promptConfig = await preparePrompt({
|
|
prompt: process.env.INPUT_PROMPT || "",
|
|
promptFile: process.env.INPUT_PROMPT_FILE || "",
|
|
});
|
|
|
|
await runClaude(promptConfig.path, {
|
|
timeoutMinutes: process.env.INPUT_TIMEOUT_MINUTES,
|
|
claudeArgs: process.env.INPUT_CLAUDE_ARGS,
|
|
});
|
|
} catch (error) {
|
|
core.setFailed(`Action failed with error: ${error}`);
|
|
core.setOutput("conclusion", "failure");
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
if (import.meta.main) {
|
|
run();
|
|
}
|