fix installation token propagation

This commit is contained in:
David Blass
2025-10-13 17:21:14 -04:00
parent 710fdd0fa4
commit c8ba7940e3
5 changed files with 13 additions and 16 deletions
+8 -2
View File
@@ -1,11 +1,11 @@
import * as core from "@actions/core";
import { type } from "arktype";
import { ClaudeAgent } from "./agents/claude.ts";
import { setupGitHubInstallationToken } from "./utils/github.ts";
export const Inputs = type({
prompt: "string",
"anthropic_api_key?": "string | undefined",
"github_installation_token?": "string | undefined",
});
export type ActionInputs = typeof Inputs.infer;
@@ -20,7 +20,13 @@ export async function main(inputs: ActionInputs): Promise<MainResult> {
try {
core.info(`→ Starting agent run with Claude Code`);
const agent = new ClaudeAgent({ apiKey: inputs.anthropic_api_key! });
// Setup GitHub installation token
const githubInstallationToken = await setupGitHubInstallationToken();
const agent = new ClaudeAgent({
apiKey: inputs.anthropic_api_key!,
githubInstallationToken
});
await agent.install();
const result = await agent.execute(inputs.prompt);