Skip to content
Merged
60 changes: 47 additions & 13 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,62 @@
name: PR Review Agent

# Thin caller for the org PR Review agent (petry-projects/.github-private),
# pinned to the known-good `pr-review/stable` channel. Adopted from the validated
# `.github-private/pr-review-trigger.yml` template (#536 consumer fan-out).
#
# - Version selection is the `pr-review/stable` tag. The `uses:` line is pinned
# to the tag's current commit SHA and must be bumped when the tag is promoted.
# `agent_ref` tracks the mutable tag so agent scripts use the promoted version.
# - `agent_ref: pr-review/stable` pins the agent's own scripts to the same
# channel (#506), so the review logic AND scripts run the known-good version.
# - Secrets are passed explicitly to the reusable workflow.
# `DON_PETRY_BOT_GH_PAT_CLASSIC` is a classic PAT — required for approvals since
# fine-grained PATs cannot `addPullRequestReview`.

on:
check_suite:
types: [completed]
pull_request_review:
types: [submitted, dismissed]
pull_request:
types: [opened, synchronize, reopened]
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]
types: [opened, ready_for_review, reopened, synchronize]
workflow_dispatch:
inputs:
pr_numbers:
description: "PR numbers to review (comma-separated)"
pr_url:
description: "Optional: review a single PR URL instead of enumerating"
required: false
type: string
dry_run:
description: "If true, never submit reviews or comments"
required: false
default: "false"
type: string
force_review:
description: "If true, bypass idempotency and re-review at the same head SHA"
required: false
default: "false"
type: string
repository_dispatch:
types: [pr-review-mention]

permissions: {}

concurrency:
group: pr-review-${{ github.event.pull_request.number || github.event.issue.number || github.sha }}
cancel-in-progress: true

jobs:
pr-review:
uses: petry-projects/.github-private/.github/workflows/pr-review-reusable.yml@main
review:
permissions:
contents: read
pull-requests: write
checks: read
uses: petry-projects/.github-private/.github/workflows/pr-review.yml@29e5974836bf2dbfe02f4ae9911ab2bdd4e6ef5b # pr-review/stable
with:
agent_ref: pr-review/stable
pr_url: ${{ inputs.pr_url || '' }}
dry_run: ${{ inputs.dry_run || '' }}
force_review: ${{ inputs.force_review || '' }}
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
DON_PETRY_BOT_GH_PAT: ${{ secrets.DON_PETRY_BOT_GH_PAT }}
DON_PETRY_BOT_GH_PAT_CLASSIC: ${{ secrets.DON_PETRY_BOT_GH_PAT_CLASSIC }}
GH_PAT: ${{ secrets.GH_PAT }}
Loading