Skip to content

feat: split Claude workflow into interactive + issue automation jobs - #39

Merged
don-petry merged 2 commits into
mainfrom
feat/claude-auto-pr
Apr 6, 2026
Merged

feat: split Claude workflow into interactive + issue automation jobs#39
don-petry merged 2 commits into
mainfrom
feat/claude-auto-pr

Conversation

@don-petry

@don-petry don-petry commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Splits the single claude job into two: claude (interactive PR reviews and @claude mentions) and claude-issue (issue-triggered automation).
  • The claude-issue job runs in automation mode with scoped tools to create PRs, self-review, check CI, and tag code owners when ready.
  • Adds actions: read and checks: read permissions to both jobs, aligning with the org standard in petry-projects/.github.

Test plan

  • Label an issue with claude and verify the claude-issue job triggers, creates a PR, self-reviews, and tags code owners.
  • Open a PR and verify the claude job runs for automatic code review.
  • Comment @claude on a PR and verify the interactive job responds.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced automated job for issues labeled "claude" that automatically generates pull requests and iterates on feedback through code review and CI processes
  • Chores

    • Updated GitHub Actions workflow to reorganize event triggers and refine job permissions for improved workflow management

Aligns with the org standard in petry-projects/.github. The claude-issue
job runs in automation mode with tools to create PRs, self-review,
check CI, and tag code owners when ready.

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

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR refactors the Claude Code GitHub Actions workflow by removing issue-triggered logic from the existing claude job and introducing a new claude-issue job specifically designed to handle labeled issues with automation for PR creation, reviews, and CI management.

Changes

Cohort / File(s) Summary
Claude Code Workflow Updates
.github/workflows/claude.yml
Refactored claude job to remove issue-triggered logic and added explicit permissions (actions: read, checks: read). Introduced new claude-issue job that triggers on labeled issues to automate issue resolution via PR creation, self-review, CI management, and owner notification using Claude Code action with constrained tools and multi-step prompt directives.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: splitting the Claude workflow into two distinct jobs (interactive and issue automation), which aligns perfectly with the file changes showing the removal of issue-triggered logic from the original job and the introduction of a new dedicated claude-issue job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/claude-auto-pr

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Splits the existing Claude Code GitHub Actions workflow into two separate jobs to support both interactive PR review usage and issue-label-triggered automation, aligning permissions with the referenced org standard.

Changes:

  • Split the single claude job into claude (interactive PR reviews / @claude mentions) and claude-issue (issue labeled automation).
  • Added actions: read and checks: read permissions to both jobs and passed them via additional_permissions.
  • Configured claude-issue to run in automation mode with a constrained tool allowlist and a multi-step implementation/review/CI prompt.
Comments suppressed due to low confidence (1)

.github/workflows/claude.yml:43

  • The pinned actions/checkout commit hash here is the same one referenced elsewhere in this repo as # v4 (e.g., .github/workflows/codeql.yml). The # v6.0.2 annotation is likely incorrect/misleading; please align the inline version comment with the actual release for this pin.
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:

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

Comment on lines +82 to +94
claude_args: |
--allowedTools "Bash(gh pr create:*),Bash(gh pr view:*),Bash(gh run view:*),Bash(gh run watch:*),Bash(cat:*),Edit,Write"
prompt: |
Implement a fix for issue #${{ github.event.issue.number }}.

After implementing:
1. Create a pull request with a clear title and description. Include "Closes #${{ github.event.issue.number }}" in the PR body.
2. Self-review your own PR — look for bugs, style issues, missed edge cases, and test gaps. If you find problems, push fixes.
3. Review all comments and review threads on the PR. For each one:
- If you can address the feedback, make the fix, push, and mark the conversation as resolved.
- If the comment requires human judgment, leave a reply explaining what you need.
4. Check CI status. If CI fails, read the logs, fix the issues, and push again. Repeat until CI passes.
5. When CI is green, all actionable review comments are resolved, and the PR is ready, read the CODEOWNERS file and leave a comment tagging the relevant code owners to review and merge.

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The allowed tool set for claude-issue doesn't appear to permit several actions required by the prompt (leaving PR comments/replies, resolving review threads, and tagging code owners). With only gh pr create/view and gh run view/watch, the job likely can't complete steps 3 and 5 of the prompt. Expand the allowed tools to include the minimal gh commands/APIs needed for commenting and thread resolution (and any other operations you expect the automation to perform).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed: added gh pr comment and gh issue comment to --allowedTools, and removed Bash(cat:*). Note that git commit/push and comment management are already in the action's base tool set — --allowedTools only adds additional tools on top of those defaults.

checks: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

Same as above: this actions/checkout pin uses the same commit hash that other workflows annotate as # v4, so the # v6.0.2 comment is likely inaccurate. Align the inline version comment to avoid confusion when updating pins later.

Suggested change
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The SHA de0fac2e4500dabe0009e67214ff5f5447ce83dd maps to actions/checkout v6.0.2, not v4. The comment is correct.

- Add concurrency group keyed on issue number to prevent duplicate runs
- Add gh pr comment and gh issue comment to allowedTools for review
  replies, thread resolution, and code owner tagging
- Remove Bash(cat:*) since the Read tool already covers file reads

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Apr 6, 2026

Copy link
Copy Markdown

@don-petry
don-petry merged commit a171dbf into main Apr 6, 2026
11 of 13 checks passed
@don-petry
don-petry deleted the feat/claude-auto-pr branch April 6, 2026 11:54
don-petry added a commit that referenced this pull request Aug 3, 2026
…39)

* feat: split Claude workflow into interactive + issue automation jobs

Aligns with the org standard in petry-projects/.github. The claude-issue
job runs in automation mode with tools to create PRs, self-review,
check CI, and tag code owners when ready.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add concurrency guard and comment tools to claude-issue job

- Add concurrency group keyed on issue number to prevent duplicate runs
- Add gh pr comment and gh issue comment to allowedTools for review
  replies, thread resolution, and code owner tagging
- Remove Bash(cat:*) since the Read tool already covers file reads

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: DJ <dj@Rachels-MacBook-Air.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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