fix: write execution file when SDK throws (#1255)

This commit is contained in:
JerryLee
2026-05-14 15:37:28 -07:00
committed by GitHub
parent 0756f6ef2b
commit 1450f658d3
6 changed files with 157 additions and 10 deletions
+2
View File
@@ -40,6 +40,7 @@ import { installPlugins } from "../../base-action/src/install-plugins";
import { preparePrompt } from "../../base-action/src/prepare-prompt";
import { runClaude } from "../../base-action/src/run-claude";
import type { ClaudeRunResult } from "../../base-action/src/run-claude-sdk";
import { setExecutionFileOutputIfPresent } from "../../base-action/src/execution-file";
/**
* Install Claude Code CLI, handling retry logic and custom executable paths.
@@ -296,6 +297,7 @@ async function run() {
core.setOutput("conclusion", claudeResult.conclusion);
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
executionFile ??= setExecutionFileOutputIfPresent();
// Only mark as prepare failure if we haven't completed the prepare phase
if (!prepareCompleted) {
prepareSuccess = false;