Fail setup when activated Python runtime detection fails

This commit is contained in:
William Woodruff
2026-09-03 15:48:24 -04:00
parent 18b7c1ee5f
commit 358b824344
6 changed files with 34 additions and 30 deletions
+3 -4
View File
@@ -1,7 +1,6 @@
import { execFile } from "node:child_process";
import { join } from "node:path";
import { promisify } from "node:util";
import * as core from "@actions/core";
import type { SetupInputs } from "./inputs";
const execFileAsync = promisify(execFile);
@@ -79,9 +78,9 @@ export async function getPythonRuntimeId(inputs: SetupInputs): Promise<string> {
);
return formatRuntimeId(JSON.parse(stdout));
} catch (error) {
core.debug(
`Failed to identify the activated environment's Python runtime. Error: ${error instanceof Error ? error.message : String(error)}`,
throw new Error(
`Failed to identify the activated environment's Python runtime: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error },
);
return "";
}
}