Skip to content

Conversation

@adamfri
Copy link
Collaborator

@adamfri adamfri commented Feb 9, 2026

No description provided.

@claude
Copy link
Contributor

claude bot commented Feb 9, 2026

Code Review

Found 2 issues:

1. Overly broad git command allowlist (line 55)

The "Bash(git *)" pattern allows any git command including destructive ones. Should restrict to specific commands needed.

2. workflow_dispatch logic error (lines 10-11)

Manual dispatch will push directly to default branch without PR review.

Details in full review comment.

@claude
Copy link
Contributor

claude bot commented Feb 9, 2026

Detailed Code Review

Issue 1: Overly broad git command allowlist (Line 55) 🔴

Location: .github/workflows/readme-check.yml:55

Issue: The "Bash(git *)" pattern in claude_args allows any git command, including destructive operations like git push --force, git reset --hard, git branch -D, etc.

Why this matters: The --allowed-tools configuration is the enforcement mechanism for what Claude can execute - the prompt text is advisory but not a hard boundary. Since this workflow processes untrusted input (PR content, file contents from contributor branches), an overly broad allowlist creates an unnecessary attack surface.

Recommendation: The workflow only needs git config, git add, git commit, and git push, so restrict the allowlist to exactly those commands.


Issue 2: workflow_dispatch will push directly to default branch (Lines 10-11) 🔴

Location: .github/workflows/readme-check.yml:10-11

Issue: When triggered via workflow_dispatch, the workflow checks out the default branch. If Claude detects README discrepancies, the prompt unconditionally instructs git push (line 53), which will push commits directly to the default branch without PR review.

Why this matters: The comment on line 11 acknowledges this behavior, but the prompt logic does not enforce it - the git push instruction on line 53 executes regardless of whether a PR number exists. The conditional branching in the prompt only affects whether to post a comment or print to terminal, not whether to push.

Recommended fix: Make the git push conditional in the prompt or remove workflow_dispatch entirely.

@adamfri adamfri merged commit 777c464 into main Feb 11, 2026
1 check passed
@adamfri adamfri deleted the readme-updater-workflow branch February 11, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant