Skip to content

Use shared claude-review reusable workflow#1874

Open
leighmcculloch wants to merge 1 commit into
mainfrom
claude-review-reusable
Open

Use shared claude-review reusable workflow#1874
leighmcculloch wants to merge 1 commit into
mainfrom
claude-review-reusable

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented May 14, 2026

What

Replace the inlined claude-review.yml workflow with a call to the shared reusable workflow at stellar/actions/.github/workflows/claude-review.yml@main. Keep the existing pull_request trigger (the safer default; fork PRs can't access secrets on this event so they cannot be reviewed) and narrow the trigger types to [ready_for_review, synchronize] so Claude only reviews PRs that are marked ready and re-reviews on new commits.

Why

The same claude-review workflow is maintained across four stellar repos. Moving to stellar/actions lets all repos share one implementation, so the security model and prompt updates live in one place. The reusable workflow also adopts the harder pull_request_target flow with an author-association gate, enabling reviews of fork PRs from org members while still keeping secrets out of attacker-controlled code paths.

Example

Before — fully inlined workflow with pull_request trigger.

After:

name: Claude Review

on:
  pull_request:
    types: [ready_for_review, synchronize]

concurrency:
  group: claude-review-${{ github.event.pull_request.number }}
  cancel-in-progress: true

permissions: {}

jobs:
  review:
    uses: stellar/actions/.github/workflows/claude-review.yml@main
    secrets:
      anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

Note

Requires the corresponding PR in stellar/actions to be merged first so that stellar/actions/.github/workflows/claude-review.yml@main resolves:

Copilot AI review requested due to automatic review settings May 14, 2026 13:40
Copy link
Copy Markdown
Contributor

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 migrates the repository’s Claude PR review automation from an inlined workflow definition to a shared reusable workflow in stellar/actions, aiming to centralize maintenance and standardize the security model across Stellar repos.

Changes:

  • Replaced the inlined claude-review.yml job steps with a call to stellar/actions/.github/workflows/claude-review.yml@main.
  • Narrowed the pull_request trigger types to only ready_for_review and synchronize.
  • Passed the Anthropic API key secret through to the reusable workflow.

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
types: [ready_for_review, synchronize]
permissions: {}

jobs:
review:
Comment on lines 9 to +16
cancel-in-progress: true

permissions: {}

jobs:
review:
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
track_progress: true
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Please review this pull request with a focus on:
- Code quality and best practices
- Potential bugs or issues
- Security implications
- Performance considerations

Provide detailed feedback using inline comments for specific issues.

# --max-turns caps how many tool-use cycles Claude can run, which
# bounds token spend per invocation. The allowed `gh pr` commands are
# scoped to this PR's number so a misfire can't reach into another PR.
claude_args: |
--max-turns 30
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment ${{ github.event.pull_request.number }}:*),Bash(gh pr diff ${{ github.event.pull_request.number }}:*),Bash(gh pr view ${{ github.event.pull_request.number }}:*)"
uses: stellar/actions/.github/workflows/claude-review.yml@main
secrets:
Comment on lines 3 to +5
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
types: [ready_for_review, synchronize]
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80f17e0320

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

claude_args: |
--max-turns 30
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment ${{ github.event.pull_request.number }}:*),Bash(gh pr diff ${{ github.event.pull_request.number }}:*),Bash(gh pr view ${{ github.event.pull_request.number }}:*)"
uses: stellar/actions/.github/workflows/claude-review.yml@main
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-add token permissions on the reusable workflow call

This change removes the job-level permissions block while keeping workflow-level permissions: {}, which leaves the called reusable workflow with a GITHUB_TOKEN that has no scopes. In that state, the review workflow cannot perform core actions like reading contents or writing PR comments/reviews, so Claude review runs will fail or become non-functional for all PRs.

Useful? React with 👍 / 👎.

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
types: [ready_for_review, synchronize]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trigger on PR open so ready PRs get an initial review

Restricting pull_request.types to ready_for_review and synchronize skips the initial run for PRs that are created already non-draft, because those PRs emit opened (not ready_for_review). As a result, many PRs will not receive any Claude review until another commit is pushed, which is a functional regression from the previous workflow behavior.

Useful? React with 👍 / 👎.

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