This commit is contained in:
inigo
2025-11-18 14:28:23 -08:00
parent 9d3bab5bc7
commit 84265a4271
2 changed files with 6 additions and 12 deletions

View File

@@ -77,11 +77,6 @@ inputs:
or the action will fail. All fields are returned in a single structured_output JSON string. or the action will fail. All fields are returned in a single structured_output JSON string.
Access outputs via: fromJSON(steps.<step-id>.outputs.structured_output).<field_name> Access outputs via: fromJSON(steps.<step-id>.outputs.structured_output).<field_name>
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 required: false
default: "" default: ""

View File

@@ -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 EXECUTION_FILE = `${process.env.RUNNER_TEMP}/claude-execution-output.json`;
const BASE_ARGS = ["--verbose", "--output-format", "stream-json"]; const BASE_ARGS = ["--verbose", "--output-format", "stream-json"];
type ExecutionMessage = {
type: string;
structured_output?: Record<string, unknown>;
};
/** /**
* Sanitizes JSON output to remove sensitive information when full output is disabled * 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 * Returns a safe summary message or null if the message should be completely suppressed
@@ -137,9 +132,13 @@ export async function parseAndSetStructuredOutputs(
): Promise<void> { ): Promise<void> {
try { try {
const content = await readFile(executionFile, "utf-8"); 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<string, unknown>;
}[];
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, (m) => m.type === "result" && m.structured_output,
); );