This commit is contained in:
Colin McDonnell
2026-01-16 18:43:09 +00:00
committed by pullfrog[bot]
parent 101c666610
commit 69b9b96ddd
37 changed files with 1005 additions and 1005 deletions
+7 -14
View File
@@ -35,21 +35,14 @@ export async function run(inputsOrPrompt: Inputs | string): Promise<AgentResult>
const inputs: Inputs =
typeof inputsOrPrompt === "string" ? { prompt: inputsOrPrompt } : inputsOrPrompt;
// Mock core.getInput to simulate Github Actions input
const mockCore = {
getInput: (name: string, options?: { required?: boolean }): string => {
const value = inputs[name as keyof Inputs];
if (value === undefined || value === null) {
if (options?.required) {
throw new Error(`Input required and not supplied: ${name}`);
}
return "";
}
return String(value);
},
};
// set INPUT_* env vars for @actions/core.getInput()
for (const [key, value] of Object.entries(inputs)) {
if (value !== undefined && value !== null) {
process.env[`INPUT_${key.toUpperCase()}`] = String(value);
}
}
const result = await main(mockCore);
const result = await main();
process.chdir(originalCwd);