Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Claude Code Review

# The reviewer only needs to read the diff and post comments — contents stays
# read-only, which is the fork-PR hardening that matters (fork PRs never
# receive the OAuth token secret either). id-token: write is required:
# claude-code-action fetches an OIDC token at startup even with OAuth-token
# auth, and without the grant the action dies before the review starts.
permissions:
contents: read
pull-requests: write
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ permissions:
contents: write
pull-requests: write
issues: write
# claude-code-action fetches an OIDC token at startup even with OAuth-token
# auth — without this grant the action dies before doing anything.
id-token: write

on:
Expand All @@ -14,9 +16,21 @@ on:

jobs:
claude:
# Any GitHub user can comment on a public repo, so the @claude trigger must
# be gated to people we trust with the workflow's write permissions.
# OWNER only fires on user-owned repos — this is an org repo, where org
# members report MEMBER — so MEMBER is the arm that actually admits the
# maintainers. It covers ANY org member (including read-only ones); fine
# for a small org, but swap in a `gh api .../permission` gate step if the
# org ever outgrows the set of people who should hold contents: write.
# The gate trusts the COMMENTER, not the content — a trusted commenter can
# still point @claude at untrusted PR text; that residual is inherent.
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR') &&
((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
Loading