Repository navigation
ci: allow git-CLI write commands for ssh_signing_key commit path #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,7 +342,7 @@ jobs: | |
| claude_args: | | ||
| --max-turns 80 | ||
| --model claude-sonnet-5 | ||
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(pnpm install:*),Bash(pnpm run:*),Bash(pnpm test:*),Bash(pnpm exec:*),Bash(pnpm --filter:*),Bash(node:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr checks:*),Bash(gh pr comment:*),Bash(gh api:*)" | ||
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(pnpm install:*),Bash(pnpm run:*),Bash(pnpm test:*),Bash(pnpm exec:*),Bash(pnpm --filter:*),Bash(node:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git show:*),Bash(git checkout:*),Bash(git switch:*),Bash(git branch:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git config:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr checks:*),Bash(gh pr comment:*),Bash(gh api:*)" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate the workflow files and nearby references.
git ls-files '.github/workflows/*' | sed -n '1,120p'
echo '--- claude-pr-loop.yml matches ---'
rg -n 'allowedTools|git push|git config|git branch|UNTRUSTED DATA|never push to main|main' .github/workflows/claude-pr-loop.yml
echo '--- claude-implement.yml matches ---'
rg -n 'allowedTools|git push|git config|git branch|UNTRUSTED DATA|never push to main|main' .github/workflows/claude-implement.yml
echo '--- surrounding context in claude-pr-loop.yml ---'
sed -n '300,380p' .github/workflows/claude-pr-loop.yml
echo '--- surrounding context in claude-implement.yml ---'
sed -n '300,380p' .github/workflows/claude-implement.ymlRepository: allxsmith/bestax Length of output: 7150 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- claude-implement.yml around the allowlist ---'
sed -n '90,190p' .github/workflows/claude-implement.yml
echo '--- claude-pr-loop.yml around the allowlist ---'
sed -n '330,380p' .github/workflows/claude-pr-loop.ymlRepository: allxsmith/bestax Length of output: 10182 Tighten the
🤖 Prompt for AI Agents |
||
| prompt: | | ||
| REPO: ${{ github.repository }} | ||
| PR NUMBER: ${{ needs.gate.outputs.pr }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Does claude-code-action support a disallowedTools or deny-rule input alongside --allowedTools?💡 Result:
Yes, claude-code-action supports the use of both --allowedTools and --disallowedTools [1][2]. You can pass these flags through the claude_args input in your GitHub Actions workflow configuration [1][2]. The claude_args parameter is designed to accept any valid Claude Code CLI arguments [1][2]. Example usage in a GitHub Action: - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} claude_args: "--allowedTools Read,Grep --disallowedTools Bash" Key behaviors for these tools include: - Both flags accept the same rule format, such as ToolName(specifier) [3]. - If both --allowedTools and --disallowedTools are set, --disallowedTools takes precedence; if a tool is listed in both, it is removed [3]. - Deny rules (via --disallowedTools) are restrictive and cannot be overridden by allow rules [4]. For example, a tool denied at any configuration level (including managed settings) cannot be re-allowed by the CLI flag [4].
Citations:
🏁 Script executed:
Repository: allxsmith/bestax
Length of output: 14202
🌐 Web query:
claude-code-action disallowedTools precedence allowedTools deny rules git push git config CLI arguments💡 Result:
In Claude Code, permission rules are evaluated in a strict order: deny, then ask, then allow [1][2]. A deny rule at any scope (user, project, or CLI) takes precedence and cannot be overridden by an allow rule at another scope or the same scope [1][2]. Regarding tool configuration and precedence: 1. Settings Precedence: Configuration follows a hierarchy where managed settings cannot be overridden, followed by CLI arguments (temporary session overrides), local project settings (.claude/settings.local.json), shared project settings (.claude/settings.json), and finally user settings (~/.claude/settings.json) [1][2]. 2. Deny Rules: A broader deny rule (e.g., Bash(aws *)) blocks all matching calls, including those that might otherwise be matched by a narrower allow rule [1][2]. 3. AllowedTools vs. DisallowedTools: - --allowedTools (whitelist) pre-approves tools. If a tool is not in the allowlist, it falls through to the configured permission mode [3]. - --disallowedTools (blacklist) removes tool definitions from the request entirely, meaning Claude cannot see or attempt them [3]. Disallowed tools cannot be re-enabled by allow rules [1][2]. 4. Git Push and CLI Arguments: - Claude Code contains an undocumented, harness-level safety guard that blocks assistant-initiated git push to the default branch [4]. This guard acts independently of standard permission rules, meaning it can fire even if Bash(git push *) is explicitly allowed in settings [4]. - CLI arguments like --allowedTools, --disallowedTools, and --permission-mode provide temporary overrides for the current session [1][5]. Note that --allowedTools may appear to be ignored if using --permission-mode bypassPermissions, as the latter bypasses standard permission checks [6]. To manage Git or other sensitive operations, it is recommended to use specific deny rules to refine broader allow rules (e.g., allowing Bash(git *) while denying Bash(git push --force *)) [7]. Since there is no documented opt-out for the default-branch push guard, it remains active by default [4].
Citations:
🏁 Script executed:
Repository: allxsmith/bestax
Length of output: 2871
Narrow the git tool permissions.
Bash(git push:*),Bash(git branch:*), andBash(git config:*)are prefix-based, so this still allows force-pushes, branch deletion/renames, and arbitrary config writes.claude-code-actionsupports--disallowedTools, so deny the dangerous subcommands explicitly and dropgit configif this flow doesn’t need it.🤖 Prompt for AI Agents