Skip to content

Conversation

@bosconi
Copy link
Member

@bosconi bosconi commented Dec 8, 2025

Add the Claude Code GitHub actions associated with the Claude / GitHub integration.

The security recommendations here are implemented as follow up commits:
https://chatgpt.com/share/e/693213d7-032c-8000-b36e-fa22ad663b64

With these changes, it is only possible to use Claude from PR comments. Possibly a moot point for this repo, since issues are disabled/hosted elsewhere.

Use only from comments is still useful: You can use it to conduct a review of code in the PR, or to add code/documentation to the (possibly stub) PR.

bosconi and others added 6 commits December 4, 2025 17:02
Only allow OWNER, MEMBER, and COLLABORATOR to trigger the @claude
assistant workflow. This prevents random external users from consuming
API quota on the public repository.
Since we're using claude_code_oauth_token for authentication, we don't
need id-token: write (which is only for OIDC auth with Bedrock/Vertex).

Keep actions: read in the assistant workflow since it explicitly uses
additional_permissions to read CI results.
Pin actions/checkout and anthropics/claude-code-action to specific
commit SHAs to prevent supply-chain attacks via compromised tags.

- actions/checkout: v4.2.2 -> 11bd719
- anthropics/claude-code-action: v1 -> 3a38b37

These should be updated periodically when new versions are released.
Remove issue creation/assignment and PR review submission events,
keeping only comment-based triggers. This reduces the event surface
area and ensures @claude is only invoked through explicit comment
mentions, making it harder to trigger accidentally.
@bosconi bosconi requested a review from a team as a code owner December 8, 2025 21:52
@jubrad
Copy link
Contributor

jubrad commented Dec 9, 2025

I think it might be good to outline what we're trying to (and not trying to) achieve with AI code reviews.
Our north star on PR reviews comes from our changes guide.

claude-review:
if: |
(
github.event_name == 'issue_comment' &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? In your description you said:

With these changes, it is only possible to use Claude from PR comments

permissions:
contents: read
pull-requests: read
issues: read
Copy link
Contributor

Choose a reason for hiding this comment

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

same


steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty old, but doesn't matter I guess.


- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@3a38b377b30c75102b420405ed9516b57ca2e248 # v1
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't even find this commit in their repo: anthropics/claude-code-action@3a38b37 So I think this won't work.
Also "v1" is kind of non-descript, would be better to say which specific one we use, for example v1.0.22

- Security concerns
- Test coverage

Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
Copy link
Contributor

Choose a reason for hiding this comment

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

This file doesn't exist, did you mean doc/developer/{best-practices.md,guide-changes.md}?

- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this something more targeted?

Suggested change
- Test coverage
- Were relevant e2e tests added/changed, do they consider corner cases and check relevant results?

I'm still worried that Claude probably has no idea about what testing frameworks we have and whether they are used for the correct kind of testing.


# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
Copy link
Contributor

Choose a reason for hiding this comment

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

issues again?


Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
Copy link
Contributor

Choose a reason for hiding this comment

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

I bet you can make Claude comment something on another person's PR from what you write in the body of your own PR. ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

claude-code-review.yml is for code reviews. What is this file for? I don't see that Claude has any permissions to do something here?

@bosconi bosconi force-pushed the add-claude-github-actions-1764885726289 branch from 22d57f9 to b24dcc1 Compare December 12, 2025 00:19
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.

4 participants