mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 15:04:13 +08:00
* chore: remove experimental allowed domains feature Remove the experimental_allowed_domains feature which was used to restrict network access via a Squid proxy. This removes: - The input definition from action.yml - The Network Restrictions workflow step - The setup-network-restrictions.sh script - Documentation from experimental.md, usage.md, and related files - The input default from collect-inputs.ts * chore: fix formatting with prettier Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import * as core from "@actions/core";
|
|
|
|
export function collectActionInputsPresence(): void {
|
|
const inputDefaults: Record<string, string> = {
|
|
trigger_phrase: "@claude",
|
|
assignee_trigger: "",
|
|
label_trigger: "claude",
|
|
base_branch: "",
|
|
branch_prefix: "claude/",
|
|
allowed_bots: "",
|
|
mode: "tag",
|
|
model: "",
|
|
anthropic_model: "",
|
|
fallback_model: "",
|
|
allowed_tools: "",
|
|
disallowed_tools: "",
|
|
custom_instructions: "",
|
|
direct_prompt: "",
|
|
override_prompt: "",
|
|
additional_permissions: "",
|
|
claude_env: "",
|
|
settings: "",
|
|
anthropic_api_key: "",
|
|
claude_code_oauth_token: "",
|
|
github_token: "",
|
|
max_turns: "",
|
|
use_sticky_comment: "false",
|
|
use_commit_signing: "false",
|
|
};
|
|
|
|
const allInputsJson = process.env.ALL_INPUTS;
|
|
if (!allInputsJson) {
|
|
console.log("ALL_INPUTS environment variable not found");
|
|
core.setOutput("action_inputs_present", JSON.stringify({}));
|
|
return;
|
|
}
|
|
|
|
let allInputs: Record<string, string>;
|
|
try {
|
|
allInputs = JSON.parse(allInputsJson);
|
|
} catch (e) {
|
|
console.error("Failed to parse ALL_INPUTS JSON:", e);
|
|
core.setOutput("action_inputs_present", JSON.stringify({}));
|
|
return;
|
|
}
|
|
|
|
const presentInputs: Record<string, boolean> = {};
|
|
|
|
for (const [name, defaultValue] of Object.entries(inputDefaults)) {
|
|
const actualValue = allInputs[name] || "";
|
|
|
|
const isSet = actualValue !== defaultValue;
|
|
presentInputs[name] = isSet;
|
|
}
|
|
|
|
core.setOutput("action_inputs_present", JSON.stringify(presentInputs));
|
|
}
|