Skip to content

Commit 9a907c4

Browse files
authored
Merge pull request #102 from d-morrison/fix/review-allowed-bots
Fix @claude workflow config (allowed_bots + agent file tools)
2 parents 2ccaf14 + 613d13a commit 9a907c4

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/claude-code-review.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ jobs:
8585
uses: anthropics/claude-code-action@v1
8686
with:
8787
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
88+
# When claude.yml routes an `@claude review` comment here, it
89+
# dispatches this workflow via `gh workflow run`, so the run's
90+
# actor is github-actions[bot]. Without allowing that bot the
91+
# action aborts with "Workflow initiated by non-human actor" and
92+
# posts no review. The job `if:` already restricts dispatched runs
93+
# to same-repo, non-Dependabot PRs, so accepting the bot here is safe.
94+
allowed_bots: "github-actions[bot]"
8895
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
8996
# `claude-code-plugins` is a branch name, not a version tag.
9097
# Intentionally unpinned so we pick up future improvements to the

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ jobs:
353353
# is reachable too — the real bound there is the GITHUB_TOKEN scopes
354354
# plus the trusted-author gate in the job `if:` above.
355355
claude_args: |
356-
--allowedTools "Bash(Rscript -e 'lintr::lint*'),Bash(Rscript -e 'devtools::check*'),Bash(Rscript -e 'devtools::document*'),Bash(Rscript -e 'pkgdown::build*'),Bash(quarto render:*),Bash(quarto check:*),Bash(git diff:*),Bash(git log:*),Bash(git status:*),Bash(git show:*),Bash(git checkout:*),Bash(git switch:*),Bash(git branch:*),Bash(git add:*),Bash(git commit:*),Bash(git push origin:*),Bash(git push -u origin:*),Bash(gh api repos/${{ github.repository }}/:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr create:*),Bash(gh pr edit:*),Bash(gh issue view:*)" --disallowedTools "Bash(git push --force:*),Bash(git push -f:*),Bash(git push --delete:*),Bash(git push -d:*),Bash(git push --mirror:*),Bash(git push --tags:*),Bash(git push --all:*),Bash(git push origin +*),Bash(git push -u origin +*),Bash(gh api -X:*),Bash(gh api --method:*)"
356+
--allowedTools "Bash(Rscript -e 'lintr::lint*'),Bash(Rscript -e 'devtools::check*'),Bash(Rscript -e 'devtools::document*'),Bash(Rscript -e 'pkgdown::build*'),Bash(quarto render:*),Bash(quarto check:*),Bash(git diff:*),Bash(git log:*),Bash(git status:*),Bash(git show:*),Bash(git checkout:*),Bash(git switch:*),Bash(git branch:*),Bash(git add:*),Bash(git commit:*),Bash(git push origin:*),Bash(git push -u origin:*),Bash(gh api repos/${{ github.repository }}/:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr create:*),Bash(gh pr edit:*),Bash(gh issue view:*),Read,Glob,Grep,Edit,MultiEdit,Write" --disallowedTools "Bash(git push --force:*),Bash(git push -f:*),Bash(git push --delete:*),Bash(git push -d:*),Bash(git push --mirror:*),Bash(git push --tags:*),Bash(git push --all:*),Bash(git push origin +*),Bash(git push -u origin +*),Bash(gh api -X:*),Bash(gh api --method:*)"
357357
358358
# Fetch the PR's head SHA once, post-Claude, for the two steps that
359359
# both need it (the prose-post COMMITTED check and the re-request

0 commit comments

Comments
 (0)