Skip to content

Commit 0a80d21

Browse files
authored
fix: strip unused ALL_INPUTS environment variable from Claude subprocess env (#1692)
1 parent 54eadc2 commit 0a80d21

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎base-action/src/parse-sdk-options.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ export function parseSdkOptions(options: ClaudeOptions): ParsedSdkOptions {
289289
delete env.ACTIONS_ID_TOKEN_REQUEST_URL;
290290
delete env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
291291

292+
// Remove ALL_INPUTS as it is only needed during initial setup to determine
293+
// input presence (collectActionInputsPresence) and contains serialized workflow inputs.
294+
delete env.ALL_INPUTS;
295+
292296
// Build system prompt option - default to claude_code preset
293297
let systemPrompt: SdkOptions["systemPrompt"];
294298
if (options.systemPrompt) {

‎base-action/test/parse-sdk-options.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,5 +620,22 @@ describe("parseSdkOptions", () => {
620620
process.env = originalEnv;
621621
}
622622
});
623+
624+
test("should strip ALL_INPUTS from env", () => {
625+
const originalEnv = { ...process.env };
626+
process.env.ALL_INPUTS = JSON.stringify({
627+
anthropic_api_key: "sk-ant-test-key",
628+
github_token: "ghp_test_token",
629+
});
630+
631+
try {
632+
const options: ClaudeOptions = {};
633+
const result = parseSdkOptions(options);
634+
635+
expect(result.sdkOptions.env?.ALL_INPUTS).toBeUndefined();
636+
} finally {
637+
process.env = originalEnv;
638+
}
639+
});
623640
});
624641
});

0 commit comments

Comments
 (0)