Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 314f669f10 | |||
| a24275e21b | |||
| 872e620342 | |||
| 6d9c6fd2b1 | |||
| 008021df1c | |||
| d6bc0fdd64 |
+1
-6
@@ -16,7 +16,6 @@ export class ClaudeAgent implements Agent {
|
||||
startTime: 0,
|
||||
};
|
||||
|
||||
|
||||
constructor(config: AgentConfig) {
|
||||
if (!config.apiKey) {
|
||||
throw new Error("Claude agent requires an API key");
|
||||
@@ -74,7 +73,6 @@ export class ClaudeAgent implements Agent {
|
||||
core.info("Running Claude Code...");
|
||||
|
||||
try {
|
||||
|
||||
const claudePath = `${process.env.HOME}/.local/bin/claude`;
|
||||
console.log(boxString(prompt, { title: "Prompt" }));
|
||||
const args = [
|
||||
@@ -152,8 +150,7 @@ export class ClaudeAgent implements Agent {
|
||||
} catch (error: any) {
|
||||
try {
|
||||
core.endGroup();
|
||||
} catch {
|
||||
}
|
||||
} catch {}
|
||||
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
||||
return {
|
||||
success: false,
|
||||
@@ -270,7 +267,6 @@ function processJSONChunk(chunk: string, agent?: ClaudeAgent): void {
|
||||
core.info(` └─ bash_command: ${input.bash_command}`);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,7 +287,6 @@ function processJSONChunk(chunk: string, agent?: ClaudeAgent): void {
|
||||
|
||||
case "result":
|
||||
if (parsedChunk.subtype === "success") {
|
||||
|
||||
core.info(
|
||||
tableString([
|
||||
["Cost", `$${parsedChunk.total_cost_usd?.toFixed(4) || "0.0000"}`],
|
||||
|
||||
@@ -25508,7 +25508,9 @@ var actionPath = process.env.GITHUB_ACTION_PATH || process.cwd();
|
||||
function createMcpConfig(githubInstallationToken) {
|
||||
const githubRepository = process.env.GITHUB_REPOSITORY;
|
||||
if (!githubRepository) {
|
||||
throw new Error("GITHUB_REPOSITORY environment variable is required for MCP GitHub integration");
|
||||
throw new Error(
|
||||
"GITHUB_REPOSITORY environment variable is required for MCP GitHub integration"
|
||||
);
|
||||
}
|
||||
return JSON.stringify(
|
||||
{
|
||||
@@ -25518,7 +25520,8 @@ function createMcpConfig(githubInstallationToken) {
|
||||
args: [`${actionPath}/mcp/server.ts`],
|
||||
env: {
|
||||
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
||||
GITHUB_REPOSITORY: githubRepository
|
||||
GITHUB_REPOSITORY: githubRepository,
|
||||
LOG_LEVEL: "debug"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -6,7 +6,9 @@ const actionPath = process.env.GITHUB_ACTION_PATH || process.cwd();
|
||||
export function createMcpConfig(githubInstallationToken: string) {
|
||||
const githubRepository = process.env.GITHUB_REPOSITORY;
|
||||
if (!githubRepository) {
|
||||
throw new Error('GITHUB_REPOSITORY environment variable is required for MCP GitHub integration');
|
||||
throw new Error(
|
||||
"GITHUB_REPOSITORY environment variable is required for MCP GitHub integration"
|
||||
);
|
||||
}
|
||||
|
||||
return JSON.stringify(
|
||||
@@ -18,6 +20,7 @@ export function createMcpConfig(githubInstallationToken: string) {
|
||||
env: {
|
||||
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
|
||||
GITHUB_REPOSITORY: githubRepository,
|
||||
LOG_LEVEL: "debug",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pullfrog/action",
|
||||
"version": "0.0.16",
|
||||
"version": "0.0.21",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"index.js",
|
||||
|
||||
Reference in New Issue
Block a user