mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 23:14:13 +08:00
feat: simplify to two modes (tag and agent) for v1.0
BREAKING CHANGES: - Remove review mode entirely - now handled via slash commands in agent mode - Remove all deprecated backward compatibility fields (mode, anthropic_model, override_prompt, direct_prompt) - Simplify mode detection: prompt overrides everything, then @claude mentions trigger tag mode, default is agent mode - Remove slash command resolution from GitHub Action - Claude Code handles natively - Remove variable substitution - prompts passed through as-is Architecture changes: - Only two modes now: tag (for @claude mentions) and agent (everything else) - Agent mode is the default for all events including PRs - Users configure behavior via prompts/slash commands (e.g. /review) - GitHub Action is now a thin wrapper that passes prompts to Claude Code - Mode names changed: 'experimental-review' → removed entirely This aligns with the philosophy that the GitHub Action should do minimal work and delegate to Claude Code for all intelligent behavior.
This commit is contained in:
@@ -18,25 +18,11 @@ async function run() {
|
||||
// Parse GitHub context first to enable mode detection
|
||||
const context = parseGitHubContext();
|
||||
|
||||
// Auto-detect mode based on context, with optional override
|
||||
const modeOverride = process.env.MODE;
|
||||
const mode = getMode(context, modeOverride);
|
||||
const modeName = mode.name;
|
||||
// Auto-detect mode based on context
|
||||
const mode = getMode(context);
|
||||
|
||||
// Setup GitHub token based on mode
|
||||
let githubToken: string;
|
||||
if (modeName === "review" || modeName === "experimental-review") {
|
||||
// For review mode, use the default GitHub Action token
|
||||
githubToken = process.env.DEFAULT_WORKFLOW_TOKEN || "";
|
||||
if (!githubToken) {
|
||||
throw new Error("DEFAULT_WORKFLOW_TOKEN not found for review mode");
|
||||
}
|
||||
console.log("Using default GitHub Action token for review mode");
|
||||
core.setOutput("GITHUB_TOKEN", githubToken);
|
||||
} else {
|
||||
// For other modes, use the existing token exchange
|
||||
githubToken = await setupGitHubToken();
|
||||
}
|
||||
// Setup GitHub token
|
||||
const githubToken = await setupGitHubToken();
|
||||
const octokit = createOctokit(githubToken);
|
||||
|
||||
// Step 3: Check write permissions (only for entity contexts)
|
||||
|
||||
Reference in New Issue
Block a user