# OrcaCode Review — example consumer workflow. # # Copy this file into your repo at `.github/workflows/` and add one secret, # `ORCAROUTER_API_KEY`. The review logic lives in the published action, so you # never copy scripts or config. The action is pinned to a release COMMIT (its # version in the comment) rather than a movable tag; let Dependabot's # github-actions updates bump it. # # One review per push: findings post as inline PR comments, and a severity gate # can fail the check to block the merge. Make the `review` check required in # branch protection. # # From v1.7.0 (unreleased) the action also writes an "OrcaCode Review" commit # status on the PR head; once you pin the release that writes it, require that status # instead — it is the one verdict an on-demand /orcacode-review run can also # update on the PR head. name: OrcaCode Review on: # `synchronize` re-reviews on every new push and `reopened` reviews a PR that # comes back. `edited` re-reviews a PR RETARGETED to another base branch (the # job's `if:` ignores title and description edits). `ready_for_review` makes # the dashboard's trigger=ready_for_review mode fire when a draft is ready. pull_request_target: types: [opened, synchronize, reopened, ready_for_review, edited] issue_comment: types: [created] permissions: contents: read pull-requests: write issues: write # clean/fallback PR comments statuses: write # used from v1.7.0 (unreleased): the verdict on the PR head jobs: review: runs-on: ubuntu-latest # Concurrency is PER JOB, in two groups. A workflow-level group with # cancel-in-progress let ANY comment on the PR cancel an in-flight review: # every comment starts a run in the same group, which then skips. Push runs # share one group per PR and a newer push supersedes an older one; comment # runs (/orcacode-review) get their own group and never cancel a running # review. GitHub keeps one running and one pending job per group, so a newer # comment does replace a comment run still pending — the latest one runs. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'issue_comment' && 'comment' || 'pr' }}-${{ github.event.pull_request.number || github.event.issue.number }} cancel-in-progress: ${{ github.event_name != 'issue_comment' }} # Run on PR events, or when a trusted user comments the review command on a # PR. All four spellings are accepted — either prefix (`/` or `@`) with # either separator (hyphen or space) — which is the same set the OrcaCode # Review GitHub App takes. Accept the full cross or you build a trap: a # reader who writes the one spelling you left out gets no run and no error # to explain why. The command runs the privileged `pull_request_target` # workflow with the OrcaRouter secret, so only maintainers # (owner/member/collaborator) may trigger it — otherwise any participant # could burn paid quota and spam reviews without pushing new commits. if: | (github.event_name == 'pull_request_target' && (github.event.action != 'edited' || github.event.changes.base)) || (github.event_name == 'issue_comment' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '/orcacode-review') || startsWith(github.event.comment.body, '/orcacode review') || startsWith(github.event.comment.body, '@orcacode-review') || startsWith(github.event.comment.body, '@orcacode review')) && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) steps: - uses: Continuum-AI-Corp/orca-code-review@6d253e0399c84848fedc8801176d6bea77817762 # v1.6.0 with: orcarouter-api-key: ${{ secrets.ORCAROUTER_API_KEY }} # All optional — uncomment to override the defaults: # orcarouter-url: ${{ secrets.ORCAROUTER_URL }} # brand: "OrcaCode Review" # router: "orcarouter/orcacode-review" # router whose DSL picks the model # fix-first: "P0,P1" # exhaustive only: stop adding passes once one is found # block-on: "P0" # fail the check (block merge) on these # max-diff-kb: "5000" # bigger diffs skip the review (outcome: on-oversized-diff) # max-diff-files: "2000" # same skip when the diff touches more files than this # on-oversized-diff: "fail" # oversized skip fails the check; "pass" makes it advisory # settings: "true" # "false" skips the dashboard fetch — this file is authoritative # report: "true" # per-run severity counts (never code) to your control plane # timeout-minutes: "60" # wall-clock ceiling per engine pass; bump for very large PRs