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: 9 additions & 3 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [labeled]

permissions: {}

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
Comment on lines +26 to 29

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.

The new issues:labeled trigger path doesn’t apply the same authorization guard as the comment-based triggers (which require author_association in OWNER/MEMBER/COLLABORATOR). With this change, anyone who can apply the claude label can trigger a workflow run that has access to CLAUDE_CODE_OAUTH_TOKEN and contents: write. If that’s not intended, add an explicit restriction for the labeler/sender (or an early-exit validation step) so only the intended roles can trigger the automation via labels.

Copilot uses AI. Check for mistakes.
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.

contents permission is escalated to write for the entire job (all triggers), even though the comment suggests it’s only required for issue-triggered branch creation. If only the issues:labeled path needs contents: write, consider splitting into separate jobs (one for issues with contents: write, one for comment/PR triggers with contents: read) to keep least-privilege for the more frequently triggered paths.

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@1eddb334cfa79fdb21ecbe2180ca1a016e8e7d47 # v1
uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1.0.89
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
label_trigger: "claude"
Loading