diff --git a/base-action/action.yml b/base-action/action.yml index c7ee853..7aaed07 100644 --- a/base-action/action.yml +++ b/base-action/action.yml @@ -77,11 +77,6 @@ inputs: or the action will fail. All fields are returned in a single structured_output JSON string. Access outputs via: fromJSON(steps..outputs.structured_output). - - Limitations: - - All fields are returned in a single structured_output JSON string - - Field names can use any valid JSON property name (including hyphens, special characters, etc.) - - The entire structured_output string is limited to 1MB required: false default: "" diff --git a/base-action/src/run-claude.ts b/base-action/src/run-claude.ts index 10c34a5..d892d62 100644 --- a/base-action/src/run-claude.ts +++ b/base-action/src/run-claude.ts @@ -12,11 +12,6 @@ const PIPE_PATH = `${process.env.RUNNER_TEMP}/claude_prompt_pipe`; const EXECUTION_FILE = `${process.env.RUNNER_TEMP}/claude-execution-output.json`; const BASE_ARGS = ["--verbose", "--output-format", "stream-json"]; -type ExecutionMessage = { - type: string; - structured_output?: Record; -}; - /** * Sanitizes JSON output to remove sensitive information when full output is disabled * Returns a safe summary message or null if the message should be completely suppressed @@ -137,9 +132,13 @@ export async function parseAndSetStructuredOutputs( ): Promise { try { const content = await readFile(executionFile, "utf-8"); - const messages = JSON.parse(content) as ExecutionMessage[]; + const messages = JSON.parse(content) as { + type: string; + structured_output?: Record; + }[]; - const result = messages.find( + // Search backwards - result is typically last or second-to-last message + const result = messages.findLast( (m) => m.type === "result" && m.structured_output, );