docs: fix execution file parsing example by looooown2006 · Pull Request #1297 · anthropics/claude-code-action (original) (raw)
Summary
Fixes the base-action/README.md example for parsing execution_file.
The previous example looked for executionLog[i].role === 'assistant', but the execution log contains SDK events with top-level type fields. Assistant content is nested under message.content, and successful runs also include a final type: "result" event.
This updates the example to:
- prefer the final
resultevent'sresultstring; - fall back to the last assistant text block under
message.content; - document the existing
structured_outputandsession_idoutputs in the base action Outputs table; - point typed automations toward
--json-schema+structured_outputinstead of parsing the full execution log.
Tests
npx prettier@3.5.3 --check base-action/README.mdgit diff --check
Note: I did not run bun test / bun run typecheck because Bun is not installed in this local environment. This is a README-only documentation change.
Closes #1296.