Skip to content

chore: enable Claude issue trigger per org CI standard#48

Merged
don-petry merged 1 commit intomainfrom
chore/claude-issue-trigger-standard
Apr 5, 2026
Merged

chore: enable Claude issue trigger per org CI standard#48
don-petry merged 1 commit intomainfrom
chore/claude-issue-trigger-standard

Conversation

@don-petry
Copy link
Copy Markdown
Contributor

Summary

  • Add issues: [labeled] event trigger to claude.yml workflow
  • Add label_trigger: "claude" input to claude-code-action
  • Upgrade contents: readcontents: write (required for issue-triggered branch creation)
  • Pin to claude-code-action@v1.0.89

Implements the standard defined in petry-projects/.github#24.

What this enables

When the claude label is applied to an issue, Claude Code will autonomously:

  1. Read the issue
  2. Create a branch
  3. Implement the fix
  4. Open a PR

Test plan

  • CI passes (non-claude checks)
  • claude label exists on repo
  • Applying claude label to an issue triggers the workflow

🤖 Generated with Claude Code

Add issues:[labeled] event trigger and claude label support so Claude
can work issues autonomously — reading the issue, creating a branch,
implementing the fix, and opening a PR.

Matches the standard defined in petry-projects/.github#24.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 5, 2026 21:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 465cf809-0bcd-4f60-a26f-22b5e79d59c1

📥 Commits

Reviewing files that changed from the base of the PR and between 141aab9 and e2cd7b8.

📒 Files selected for processing (1)
  • .github/workflows/claude.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/claude-issue-trigger-standard

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 5, 2026

@don-petry don-petry merged commit 2f75be2 into main Apr 5, 2026
17 of 18 checks passed
@don-petry don-petry deleted the chore/claude-issue-trigger-standard branch April 5, 2026 21:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Claude automation GitHub Actions workflow to support the org-standard “label an issue to trigger Claude Code” flow, enabling autonomous branch/PR creation from labeled issues.

Changes:

  • Added an issues: [labeled] trigger and job-level condition for the claude label.
  • Updated workflow permissions to allow contents: write (needed for branch creation).
  • Pinned anthropics/claude-code-action to v1.0.89 and configured label_trigger: "claude".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot AI Apr 5, 2026

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.
Comment on lines 31 to 36
permissions:
contents: read
# write required for issue-triggered branch creation
contents: write
id-token: write
pull-requests: write
issues: write
Copy link

Copilot AI Apr 5, 2026

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.
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.

2 participants