fix: allow Claude workflows to create pull requests - #767
Conversation
📝 WalkthroughWalkthroughGitHub Actions workflows migrate Claude Code action tool configuration from JSON ChangesClaude Code Action Tool Allowlisting Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/claude.yml:
- Line 72: The allowed tools list string in the workflow step (the
--allowedTools value) is missing git commands; update the allowedTools entry
that currently contains "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr
list:*),Bash(gh pr status:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)" to also
include "Bash(git:*)" so it reads with Bash(git:*) included, ensuring the
--allowedTools configuration (the allowedTools flag line) matches
templates/workflows/claude.yml and allows the push-then-gh-pr-create flow to
complete.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5074966e-5b76-47a8-93c3-399b84caff46
📒 Files selected for processing (5)
.claude/commands/repo-maintenance.md.github/workflows/claude.yml.github/workflows/scheduled-maintenance.ymltemplates/workflows/claude.ymltemplates/workflows/scheduled-maintenance.yml
|
|
||
| # System prompt to automatically create PRs when working on Issues | ||
| claude_args: | | ||
| --allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr status:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)" |
There was a problem hiding this comment.
Add Bash(git:*) to keep PR-creation flow and template/instance behavior aligned.
This allowlist currently diverges from templates/workflows/claude.yml and may prevent the “push branch, then gh pr create” path from completing end-to-end.
Suggested patch
- --allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr status:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)"
+ --allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr status:*),Bash(git:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr status:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)" | |
| --allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr status:*),Bash(git:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/claude.yml at line 72, The allowed tools list string in
the workflow step (the --allowedTools value) is missing git commands; update the
allowedTools entry that currently contains "Bash(gh pr create:*),Bash(gh pr
view:*),Bash(gh pr list:*),Bash(gh pr
status:*),Bash(npm:*),Bash(pnpm:*),Bash(npx:*)" to also include "Bash(git:*)" so
it reads with Bash(git:*) included, ensuring the --allowedTools configuration
(the allowedTools flag line) matches templates/workflows/claude.yml and allows
the push-then-gh-pr-create flow to complete.
|
🎉 This PR is included in version 1.112.9 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
settings.permissions.allowedToolstoclaude_args --allowedToolsso they are reflected in the Claude SDK allowed tools.gh pr createand related read commands for issue-handling Claude workflows.GH_TOKEN: ${{ github.token }}to Claude action steps soghcan authenticate without committing credentials.Quality Gatecheck-runs in Claude Code Review so CI fallback + CI do not keep the review gate waiting until timeout.Verification
actionlint .github/workflows/claude.yml .github/workflows/scheduled-maintenance.yml .github/workflows/claude-code-review.yml templates/workflows/claude.yml templates/workflows/scheduled-maintenance.ymlnpx prettier --check .github/workflows/claude.yml .github/workflows/scheduled-maintenance.yml .github/workflows/claude-code-review.yml templates/workflows/claude.yml templates/workflows/scheduled-maintenance.yml .claude/commands/repo-maintenance.mdgit diff --checkQuality Gate:quality-gates-okbash script/security-credential-scan.sh --strictwas run; it reports pre-existing false positives innix/flake.lockrev hashes, unrelated to this PR.