* refactor: unify action into single composite step with run.ts entrypoint Consolidate the prepare and base-action phases into a single composite step that runs src/entrypoints/run.ts. This simplifies the action.yml from multiple steps to one execution step, while keeping the same behavior. Key changes: - Add src/entrypoints/run.ts as unified entrypoint - Simplify action.yml to single 'Run Claude Code Action' step - Pass all inputs via environment variables - Update base-action to accept inputs via env vars - Support agent mode auto-detection from prompt input * refactor: keep SSH signing cleanup and token revocation as separate action steps Move SSH signing key cleanup and app token revocation back to separate composite action steps in action.yml with always() conditions, rather than handling them inside run.ts. This keeps these cleanup concerns as independently visible steps in the workflow. * fix: address PR review feedback - Use path.dirname() instead of manual string slicing for executable path - Differentiate prepare vs execution errors in catch block so tracking comment accurately reflects which phase failed - Update CLAUDE.md architecture docs to reflect unified run.ts entrypoint and four-phase design * fix: address PR review feedback - Use path.dirname() instead of manual string slicing for executable path - Differentiate prepare vs execution errors in catch block so tracking comment accurately reflects which phase failed - Rewrite CLAUDE.md to focus on mental model, key concepts, and gotchas instead of exhaustive file listings
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
export function collectActionInputsPresence(): string {
|
|
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",
|
|
ssh_signing_key: "",
|
|
};
|
|
|
|
const allInputsJson = process.env.ALL_INPUTS;
|
|
if (!allInputsJson) {
|
|
console.log("ALL_INPUTS environment variable not found");
|
|
return JSON.stringify({});
|
|
}
|
|
|
|
let allInputs: Record<string, string>;
|
|
try {
|
|
allInputs = JSON.parse(allInputsJson);
|
|
} catch (e) {
|
|
console.error("Failed to parse ALL_INPUTS JSON:", e);
|
|
return JSON.stringify({});
|
|
}
|
|
|
|
const presentInputs: Record<string, boolean> = {};
|
|
|
|
for (const [name, defaultValue] of Object.entries(inputDefaults)) {
|
|
const actualValue = allInputs[name] || "";
|
|
|
|
const isSet = actualValue !== defaultValue;
|
|
presentInputs[name] = isSet;
|
|
}
|
|
|
|
return JSON.stringify(presentInputs);
|
|
}
|