anthropics / anthropics/claude-code-action

allowed_tools does not take effect when called twice

Offen
#287 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug p2
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

**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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.