anthropics / anthropics/claude-code-action

The github-inline-comment MCP server is not initialized for workflows triggered by `workflow_dispatch`

オープン
#635 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る
bug dev-experience mcp p2
主要言語
TypeScript
スター
8.9k
フォーク
2.1k
平均マージ
3日 9時間
マージ済み PR(30日)
10

説明

**Describe the bug**
If the action is triggered by `workflow_dispatch`, the MCP server for github-inline-comment is not initialized, and therefore Claude can't add inline comments in such a case.

**To Reproduce**
Steps to reproduce the behavior:

1. Create a flow with `workflow_dispatch` that takes the PR number
2. Add action with claude-code-action to review the PR and add inline comments
3. Look into the summary of action to see that it couldn't use mcp for inline comments

**Expected behavior**
The MCP server for the github-inline-comment is initialized, and comments are added to the PR.

**API Provider**

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

**Additional context**

We use `workflow_dispatch` to review PRs from forks. To solve the above problem, we forked claude-code-action and modified the `install-mcp-server.ts` to initialize the mcp server, also when the env: `PR_NUMBER` is provided to the action.

The current approach, which blocks the MCP server initialization if the action is not triggered by PR, can cause problems when debugging (it did for us 😄), and there is no reason to limit inline comments only to these cases.

We can help with creating PR for that
```ts
if (
isEntityContext(context) &&
context.isPR && // 🥲
(hasGitHubMcpTools || hasInlineCommentTools)
) {
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。