anthropics / anthropics/claude-code-action

allowed_tools does not take effect when called twice

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

説明

**Describe the bug**
When claude-code-action is called multiple times in a workflow, `allowed_tools` does not take effect in later calls.

**To Reproduce**
When the below workflow is run, the second one may fail due to lack of permission of `go` command.

```yaml
- uses: anthropics/claude-code-action@beta
with:
direct_prompt: ...

- uses: anthropics/claude-code-action@beta
with:
allowed_tools: |
Bash(go:*)
```

**Expected behavior**
The `allowed_tools` is independent from another call.

**API Provider**

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

**Additional context**
According to the logs, this action exports the following variables:

```yaml
env:
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:*),Bash(git config user.name:*),Bash(git config user.email:*)
DISALLOWED_TOOLS: WebSearch,WebFetch
```

I think the following code causes this problem.
https://github.com/anthropics/claude-code-action/blob/8fcb8e16b8c1353a2a862e146081ee0c2c254c0e/src/create-prompt/index.ts#L775-L776

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

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

評価

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

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

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