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
16 changes: 11 additions & 5 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Claude Code

permissions: {}

on:
pull_request:
branches: [main]
Expand All @@ -10,6 +8,10 @@ on:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [labeled]

permissions: {}

jobs:
claude:
Expand All @@ -21,17 +23,21 @@ jobs:
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, '@claude') &&
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'issues' && github.event.action == 'labeled' &&
github.event.label.name == 'claude')
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
# write required for issue-triggered branch creation
contents: write
id-token: write
pull-requests: write
issues: write
Comment on lines 31 to 36

Copilot AI Apr 5, 2026

Copy link

Choose a reason for hiding this comment

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

Job-level contents: write applies to all triggers (including pull_request and comment-based runs), expanding the GITHUB_TOKEN鈥檚 write surface beyond what鈥檚 needed for those paths. To minimize repo-write exposure, split this into two jobs with different permissions (e.g., keep contents: read for PR/comment triggers and use a separate issues-only job with contents: write), or otherwise scope elevated permissions only to the issue-labeled execution path.

Copilot uses AI. Check for mistakes.
steps:
- name: Run Claude Code
if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]'
uses: anthropics/claude-code-action@bee87b3258c251f9279e5371b0cc3660f37f3f77 # v1
uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1.0.89
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
label_trigger: "claude"
Loading