Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,15 @@ jobs:
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ github.token }}
# Review every PR, not just those from authors with write access. The action
# otherwise stops on "Actor does not have write permissions"; it needs
# github_token above to honour this. allowed_bots stays empty, so bots still
# cannot trigger a review.
allowed_non_write_users: "*"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep arbitrary commenters from spending review budget

The existing issue_comment arm at .github/workflows/claude-code-review.yml:24-28 accepts @claude full review from any commenter, and this wildcard removes the action's non-write-user gate for that event as well as for PR creation. On any public PR, a non-bot account that neither authored nor maintains the PR can now post the phrase repeatedly and start a separate 40-turn OAuth-backed review each time, with no association, label, or rate check. Restrict the manual trigger to maintainers or authorized author associations, or separate its authorization policy from automatic PR reviews.

Useful? React with 👍 / 👎.

claude_args: >
--dangerously-skip-permissions
--max-turns 40
--allowedTools
"Bash"
"Read,Write,Glob,Grep"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop persisting the token before accepting untrusted prompts

When a non-write user opens a fork PR, this workflow feeds their diff and context into Claude; the CLI reference describes --allowedTools as allowing tools “without prompting for permission” (Claude Code CLI reference), so the bare Read permission is not confined to the prepared inputs. The checkout at .github/workflows/claude-code-review.yml:67-70 leaves persist-credentials at its default, which this repository itself documents as storing GITHUB_TOKEN in an http.extraheader (coverage-refresh.yml:29-35); a prompt-injected diff can therefore have Claude read .git/config and copy this job's pull-request/issues-write token into the subsequently published output.md. Disable checkout credential persistence or isolate Claude in a tokenless job before accepting these prompts.

AGENTS.md reference: AGENTS.md:L4-L6

Useful? React with 👍 / 👎.

prompt: |
You are running in GitHub Actions review automation.

Expand All @@ -208,10 +212,10 @@ jobs:
- Do not comment on code outside the changed files, and do not give general repo suggestions or style nitpicks.

Required steps, in order; do not skip any:
1) cat .claude/CLAUDE.md
1) Read .claude/CLAUDE.md
2) Read the Common Pitfalls section of docs/documentation/contributing.md. If the diff touches GPU macros or
src/simulation, also read docs/documentation/gpuParallelization.md.
3) cat the changed files list and the diff.
3) Read the changed files list and the diff.
4) For each changed Fortran or Python file that has a context file, open it and check each changed hunk against
its surroundings: declarations, loop bounds, callers and callees within the file, comments that state what
the code does, and the matching code paths in other directions, targets or branches.
Expand Down
Loading