mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 23:14:13 +08:00
fix: address PR #683 review feedback
Critical fixes: - Remove duplicate core.setFailed() call in parseAndSetStructuredOutputs (fixes double error reporting issue) - Extract JSON schema handling to shared utility function (eliminates code duplication between agent/tag modes) Changes: - base-action/src/run-claude.ts: Remove redundant setFailed() before throw - src/utils/json-schema.ts: New shared appendJsonSchemaArg() utility - src/modes/agent/index.ts: Use shared JSON schema utility - src/modes/tag/index.ts: Use shared JSON schema utility All tests passing, types checked, code formatted. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { parseAllowedTools } from "./parse-tools";
|
||||
import { configureGitAuth } from "../../github/operations/git-config";
|
||||
import type { GitHubContext } from "../../github/context";
|
||||
import { isEntityContext } from "../../github/context";
|
||||
import { appendJsonSchemaArg } from "../../utils/json-schema";
|
||||
|
||||
/**
|
||||
* Extract GitHub context as environment variables for agent mode
|
||||
@@ -150,12 +151,7 @@ export const agentMode: Mode = {
|
||||
}
|
||||
|
||||
// Add JSON schema if provided
|
||||
const jsonSchemaStr = process.env.JSON_SCHEMA || "";
|
||||
if (jsonSchemaStr) {
|
||||
// CLI validates schema - just escape for safe shell passing
|
||||
const escapedSchema = jsonSchemaStr.replace(/'/g, "'\\''");
|
||||
claudeArgs += ` --json-schema '${escapedSchema}'`;
|
||||
}
|
||||
claudeArgs = appendJsonSchemaArg(claudeArgs);
|
||||
|
||||
// Append user's claude_args (which may have more --mcp-config flags)
|
||||
claudeArgs = `${claudeArgs} ${userClaudeArgs}`.trim();
|
||||
|
||||
Reference in New Issue
Block a user