anthropics / anthropics/claude-code-action

Tag mode filters custom Bash tools from claude_args - intentional?

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

説明

## Summary

When using `tag` mode (auto-detected for `pull_request` events), custom Bash tools specified in `claude_args` are silently filtered out. Only MCP tools prefixed with `mcp__github_` are merged with the default tool set.

## Expected Behavior

Custom tools specified via `claude_args: --allowedTools "Bash(npx markdownlint:*)"` should be available to Claude during PR reviews.

## Actual Behavior

The tools are parsed but filtered out in tag mode:

```javascript
// From src/modes/tag/index.ts
userAllowedMCPTools = parseAllowedTools(userClaudeArgs)
.filter((tool) => tool.startsWith("mcp__github_"))
```

This means `Bash(npx markdownlint:*)`, `Bash(gh pr:*)`, etc. are ignored.

## Reproduction

```yaml
# .github/workflows/claude-pr-review.yml
on:
pull_request:
types: [opened, synchronize, ready_for_review]

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"

- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Run `npx markdownlint *.md` to check markdown files.
claude_args: |
--allowedTools "Bash(npx markdownlint:*),Read,Glob"
```

**Result**: Claude reports it cannot run markdownlint due to missing permissions.

**Workaround**: Use `mode: agent` which accepts all user-provided tools.

## Questions

1. **Is this filtering intentional?** If so, what's the security/design rationale?
2. **Should tag mode support custom Bash tools?** The use case of running linters during PR review seems common.
3. **Can documentation be updated?** Either to explain the limitation or to show the `mode: agent` workaround.

## Environment

- claude-code-action version: v1.0.22
- Trigger: `pull_request` (auto-detects to `tag` mode)

## Relevant Logs

```
Auto-detected mode: tag for event: pull_request
ALLOWED_TOOLS: Edit,MultiEdit,Glob,Grep,LS,Read,Write,mcp__github_comment__update_claude_comment,Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git rm:*)
```

Note: `Bash(npx markdownlint:*)` from `claude_args` is not present in `ALLOWED_TOOLS`.

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

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

評価

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

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

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