fix: strip unused ALL_INPUTS environment variable from Claude subprocess env (#1692)

This commit is contained in:
Juwan
2026-08-18 17:23:38 -07:00
committed by GitHub
parent 54eadc2f72
commit 0a80d21df7
2 changed files with 21 additions and 0 deletions
+4
View File
@@ -289,6 +289,10 @@ export function parseSdkOptions(options: ClaudeOptions): ParsedSdkOptions {
delete env.ACTIONS_ID_TOKEN_REQUEST_URL; delete env.ACTIONS_ID_TOKEN_REQUEST_URL;
delete env.ACTIONS_ID_TOKEN_REQUEST_TOKEN; delete env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
// Remove ALL_INPUTS as it is only needed during initial setup to determine
// input presence (collectActionInputsPresence) and contains serialized workflow inputs.
delete env.ALL_INPUTS;
// Build system prompt option - default to claude_code preset // Build system prompt option - default to claude_code preset
let systemPrompt: SdkOptions["systemPrompt"]; let systemPrompt: SdkOptions["systemPrompt"];
if (options.systemPrompt) { if (options.systemPrompt) {
@@ -620,5 +620,22 @@ describe("parseSdkOptions", () => {
process.env = originalEnv; process.env = originalEnv;
} }
}); });
test("should strip ALL_INPUTS from env", () => {
const originalEnv = { ...process.env };
process.env.ALL_INPUTS = JSON.stringify({
anthropic_api_key: "sk-ant-test-key",
github_token: "ghp_test_token",
});
try {
const options: ClaudeOptions = {};
const result = parseSdkOptions(options);
expect(result.sdkOptions.env?.ALL_INPUTS).toBeUndefined();
} finally {
process.env = originalEnv;
}
});
}); });
}); });