Skip to content

SST-259 Add Claude code review workflow for pull requests - #1581

Merged
yuryyas merged 3 commits into
mainfrom
claude_pr_review
Nov 19, 2026
Merged

yuryyas merged 3 commits into
mainfrom
claude_pr_review

Conversation

@yuryyas

@yuryyas yuryyas commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

New workflow .github/workflows/claude-review.yml runs Claude Code on every PR to review it and post comments.

on pull_request (opened | synchronize | reopened | ready_for_review)
  skip if draft, dependabot, or fork
  key = branch name prefix matching (CS|SST)-<n>        # CS-447_Reports_... -> CS-447
  if key: start read-only Jira MCP (mcp-atlassian, jira_get_issue only)
  claude-code-action:
    range = "Reviewed up to <sha>" from claude[bot]'s summary comment
            else github.event.before on push
            else whole PR
    load Jira ticket `key` → check the change does what the ticket asks
    review diff → inline comments on changed lines (skip issues already raised)
    update ONE "## Claude review" summary comment (gh pr comment --edit-last)
  • Model claude-opus-5-5, max 40 turns, 20 min timeout. A new push cancels the run still in progress, and the next run picks up its commits.
  • Tools are read-only git/gh, file reads, inline comments and the PR summary comment. Claude can't edit, push, approve or merge.

Setup required before marking ready (admin)

No keys are stored in the repo. The workflow reads them from repository secrets (Settings → Secrets and variables → Actions):

Secret Value
ANTHROPIC_API_KEY <Anthropic API key from the org Claude Console; separate workspace with a monthly spend limit>
JIRA_USERNAME <email of a read-only Jira service account>
JIRA_API_TOKEN <API token for that account, created at id.atlassian.com → Security → API tokens>
  • Install the Claude GitHub App on this repo: https://github.com/apps/claude (Contents, Issues, Pull requests read/write). The workflow authenticates as claude[bot] through it.
  • Add the three secrets above.
  • Limit the Jira service account to the CS and SST projects.

Evidence

Checked locally:

  • The workflow YAML and the embedded MCP JSON both parse.
  • The branch-key regex returns CS-447_Reports_reappearing_after_removal → CS-447, SST-5-Validate-... → SST-5, and nothing for emails_validation_fix, dependabot/..., OS-123-x.
  • gh pr comment supports --edit-last --create-if-none.

Not tested yet (needs the secrets and the App):

  • An end-to-end run.
  • ${JIRA_*} expansion inside --mcp-config.
  • That --edit-last edits the bot's own summary comment.
  • The runtime tool name mcp__jira__jira_get_issue.

This PR is a draft, so the workflow skips it. Once setup is done, mark it ready for review: it then reviews itself, which is the first real test.

Merge Danger

Door: two-way. Delete the file or disable the workflow to turn it off.

Blast Radius: PR comments.

  • It doesn't block anything: it isn't a required check and it never approves or requests changes.
  • Cost: each push to a non-draft PR is one Opus run. The Console workspace spend limit caps it.
  • Public repo: anyone can comment on PRs, and Claude reads PR text. The prompt treats all PR, comment and Jira text as data. Claude may load only the ticket named in the branch, and must not quote or paraphrase Jira content in its comments. The Jira account should still be limited to CS/SST.

🤖 Generated with Claude Code

Reviews each PR on open and on every push (only new commits), posts
inline comments plus one summary comment that is updated in place, and
loads the Jira ticket from the branch name (CS-/SST-) as context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Unit Test Results

358 tests   358 ✔️  14m 50s ⏱️
241 suites      0 💤
    1 files        0 ❌

Results for commit 8aa0e42.

♻️ This comment has been updated with latest results.

@yuryyas
yuryyas marked this pull request as ready for review November 17, 2026 13:18
@yuryyas
yuryyas requested a review from ari as a code owner November 17, 2026 13:18
@yuryyas yuryyas changed the title Add Claude code review workflow for pull requests SST-259 Add Claude code review workflow for pull requests Nov 17, 2026
@yuryyas
yuryyas merged commit 2428655 into main Nov 19, 2026
6 checks passed
@yuryyas
yuryyas deleted the claude_pr_review branch November 19, 2026 17:01
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.

1 participant