diff --git a/CLAUDE.md b/CLAUDE.md index 338c319..22ad980 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,6 +62,6 @@ src/ When adding new MCP tools: 1. **Add to MCP Server**: Implement the tool in the appropriate MCP server file (e.g., `src/mcp/local-git-ops-server.ts`) -2. **Expose to Claude**: Add the tool name to `BASE_ALLOWED_TOOLS` array in `src/create-prompt/index.ts` +2. **Expose to Claude**: Add the tool name to `BASE_ALLOWED_TOOLS` array in `src/create-prompt/index.ts` 3. **Tool Naming**: Follow the pattern `mcp__server_name__tool_name` (e.g., `mcp__local_git_ops__checkout_branch`) 4. **Documentation**: Update the prompt's "What You CAN Do" section if the tool adds new capabilities diff --git a/README.md b/README.md index cd35d91..bdca7cf 100644 --- a/README.md +++ b/README.md @@ -68,21 +68,21 @@ jobs: ## Inputs -| Input | Description | Required | Default | -| --------------------- | -------------------------------------------------------------------------------------------------------------------- | -------- | ---------- | -| `anthropic_api_key` | Anthropic API key (required for direct API, not needed for Bedrock/Vertex) | No\* | - | -| `direct_prompt` | Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows) | No | - | -| `timeout_minutes` | Timeout in minutes for execution | No | `30` | -| `gitea_token` | Gitea token for Claude to operate with. **Only include this if you're connecting a custom GitHub app of your own!** | No | - | -| `model` | Model to use (provider-specific format required for Bedrock/Vertex) | No | - | -| `anthropic_model` | **DEPRECATED**: Use `model` instead. Kept for backward compatibility. | No | - | -| `use_bedrock` | Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API | No | `false` | -| `use_vertex` | Use Google Vertex AI with OIDC authentication instead of direct Anthropic API | No | `false` | -| `allowed_tools` | Additional tools for Claude to use (the base GitHub tools will always be included) | No | "" | -| `disallowed_tools` | Tools that Claude should never use | No | "" | -| `custom_instructions` | Additional custom instructions to include in the prompt for Claude | No | "" | -| `assignee_trigger` | The assignee username that triggers the action (e.g. @claude). Only used for issue assignment | No | - | -| `trigger_phrase` | The trigger phrase to look for in comments, issue/PR bodies, and issue titles | No | `@claude` | +| Input | Description | Required | Default | +| --------------------- | ------------------------------------------------------------------------------------------------------------------- | -------- | --------- | +| `anthropic_api_key` | Anthropic API key (required for direct API, not needed for Bedrock/Vertex) | No\* | - | +| `direct_prompt` | Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows) | No | - | +| `timeout_minutes` | Timeout in minutes for execution | No | `30` | +| `gitea_token` | Gitea token for Claude to operate with. **Only include this if you're connecting a custom GitHub app of your own!** | No | - | +| `model` | Model to use (provider-specific format required for Bedrock/Vertex) | No | - | +| `anthropic_model` | **DEPRECATED**: Use `model` instead. Kept for backward compatibility. | No | - | +| `use_bedrock` | Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API | No | `false` | +| `use_vertex` | Use Google Vertex AI with OIDC authentication instead of direct Anthropic API | No | `false` | +| `allowed_tools` | Additional tools for Claude to use (the base GitHub tools will always be included) | No | "" | +| `disallowed_tools` | Tools that Claude should never use | No | "" | +| `custom_instructions` | Additional custom instructions to include in the prompt for Claude | No | "" | +| `assignee_trigger` | The assignee username that triggers the action (e.g. @claude). Only used for issue assignment | No | - | +| `trigger_phrase` | The trigger phrase to look for in comments, issue/PR bodies, and issue titles | No | `@claude` | \*Required when using direct Anthropic API (default and when not using Bedrock or Vertex) diff --git a/src/entrypoints/update-comment-link.ts b/src/entrypoints/update-comment-link.ts index d00fcc4..d171cb2 100644 --- a/src/entrypoints/update-comment-link.ts +++ b/src/entrypoints/update-comment-link.ts @@ -32,7 +32,7 @@ async function run() { const client = createClient(githubToken); const serverUrl = GITEA_SERVER_URL; - const jobUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const jobUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${process.env.GITHUB_RUN_NUMBER}`; let comment; let isPRReviewComment = false; diff --git a/src/github/context.ts b/src/github/context.ts index 0fb7f65..1c94518 100644 --- a/src/github/context.ts +++ b/src/github/context.ts @@ -40,7 +40,7 @@ export function parseGitHubContext(): ParsedGitHubContext { const context = github.context; const commonFields = { - runId: process.env.GITHUB_RUN_ID!, + runId: process.env.GITHUB_RUN_NUMBER!, eventName: context.eventName, eventAction: context.payload.action, repository: { diff --git a/src/mcp/local-git-ops-server.ts b/src/mcp/local-git-ops-server.ts index d79cdfb..f0d380f 100644 --- a/src/mcp/local-git-ops-server.ts +++ b/src/mcp/local-git-ops-server.ts @@ -136,11 +136,15 @@ server.tool( create_if_missing: z .boolean() .optional() - .describe("Create branch if it doesn't exist locally (defaults to false)"), + .describe( + "Create branch if it doesn't exist locally (defaults to false)", + ), fetch_remote: z .boolean() .optional() - .describe("Fetch from remote if branch doesn't exist locally (defaults to true)"), + .describe( + "Fetch from remote if branch doesn't exist locally (defaults to true)", + ), }, async ({ branch_name, create_if_missing = false, fetch_remote = true }) => { try { @@ -150,17 +154,23 @@ server.tool( runGitCommand(`git rev-parse --verify ${branch_name}`); branchExists = true; } catch (error) { - console.log(`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist locally`); + console.log( + `[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist locally`, + ); } // If branch doesn't exist locally, try to fetch from remote if (!branchExists && fetch_remote) { try { - console.log(`[LOCAL-GIT-MCP] Attempting to fetch ${branch_name} from remote`); + console.log( + `[LOCAL-GIT-MCP] Attempting to fetch ${branch_name} from remote`, + ); runGitCommand(`git fetch origin ${branch_name}:${branch_name}`); branchExists = true; } catch (error) { - console.log(`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist on remote`); + console.log( + `[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist on remote`, + ); } } @@ -180,7 +190,9 @@ server.tool( // If branch doesn't exist and we can't/won't create it, throw error if (!branchExists) { - throw new Error(`Branch '${branch_name}' does not exist locally or on remote. Use create_if_missing=true to create it.`); + throw new Error( + `Branch '${branch_name}' does not exist locally or on remote. Use create_if_missing=true to create it.`, + ); } // Checkout the existing branch