Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
06cac60
fix(action): keep github.token out of step scripts and off git's argv…
claude Oct 31, 2026
4b4a0f7
fix(gate): fail the merge gate closed when gate.mjs cannot decide (CR…
claude Oct 31, 2026
9d4b913
fix(settings): a dashboard outage can tighten block_on, never loosen …
claude Oct 31, 2026
f6f22f4
fix(proxy): pin the proxy to one https endpoint and keep the key out …
claude Oct 31, 2026
d0529ec
fix(action): harden the PR checkout before anything reads it (CR-4, C…
claude Oct 31, 2026
41251a7
fix(posting): one sanitising, redacting funnel for everything the act…
claude Oct 31, 2026
fce1d7c
fix(filters): folding findings keeps the highest severity; the judge …
claude Oct 31, 2026
3fadd1a
fix(action): refuse untrusted comment triggers, safe author default, …
claude Oct 31, 2026
b0f2fe5
fix(workflows): per-job concurrency, re-run on retarget/reopen, statu…
claude Oct 31, 2026
97a9e53
fix(action): only the action's own comments count as its marker comme…
claude Oct 31, 2026
93a84b8
fix(supply-chain): install the engine from pinned, verified bytes; SH…
claude Oct 31, 2026
248d968
fix(release): pin the action to a release commit everywhere; never mo…
claude Oct 31, 2026
5d0540c
fix(installer): "Everyone" writes auto-review-authors: "*" (CR-2)
claude Oct 31, 2026
04814f0
docs: make SECURITY.md, README and the skill match the hardened behav…
claude Oct 31, 2026
e059b29
test(helpers): run action steps from an environment without the runne…
claude Oct 31, 2026
096a63c
fix(sanitizer): tokenize like the renderer; judge the output with a r…
claude Oct 31, 2026
2a90f74
fix(redaction): catch hex copies and copies split by invisible charac…
claude Oct 31, 2026
328fc31
fix(skips): a settings skip passes the job again; the head-SHA status…
claude Oct 31, 2026
1137527
fix(settings): a 4xx means "no dashboard settings"; an outage uses th…
claude Oct 31, 2026
88e727f
fix(release): keep everything we hand out true of the pinned v1.6.0
claude Oct 31, 2026
9776a53
docs: hold inputs.md to action.yml; say precisely what a comment can …
claude Oct 31, 2026
cfb2c3a
fix(identity): one funnel decides who the action is; an App token is …
claude Oct 31, 2026
697d29a
fix(gateway-url): one judge of where the key may go; a refusal names …
claude Oct 31, 2026
1420516
fix(guard): standard lockfiles do not count toward the diff-size limit
claude Oct 31, 2026
04ed391
fix(events): run on an explicit allowlist of events; refuse the rest,…
claude Oct 31, 2026
cc7f3c0
fix(spend): on a push to a fork PR, judge the pusher, not only the au…
claude Oct 31, 2026
37a1397
fix(comments): a fork PR's /orcacode-review must name the commit, and…
claude Oct 31, 2026
91ccf41
docs: the action's header and the skill's troubleshooting list match …
claude Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Keeps every pinned `uses:` (action.yml and .github/workflows, each pinned to a
# commit SHA with its version in a `# vX.Y.Z` comment) current: Dependabot
# reads the comment, finds the newer release and opens a PR that bumps the SHA
# and the comment together — the update arrives as a reviewable diff instead of
# a tag that moved underneath us.
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions:
patterns: ["*"]
4 changes: 2 additions & 2 deletions .github/workflows/deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
VERSIONS: ${{ inputs.versions }}
MESSAGE: ${{ inputs.message }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
Expand Down
57 changes: 39 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# closed if any of it is off.
#
# NOTE: this workflow deliberately creates no git tags. The npm package version
# and the action's own `v1.x` release tags are SEPARATE version lines (the
# action is on v1.4.x while the CLI starts at 1.0.0). Tagging `v1.0.0` here
# would collide with the action's tag series and could move consumers'
# `uses: ...@v1` onto the wrong commit. Action tags stay manual — see RELEASE.md.
# and the action's own `v1.x` release tags are SEPARATE version lines, and
# action release tags are created by hand, once, and never moved — see
# RELEASE.md.

name: Publish

Expand All @@ -42,11 +41,11 @@ jobs:
contents: read
id-token: write # provenance attestation; not used for auth
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0 # the v1 tag check below needs the tag objects
fetch-depth: 0 # the pinned-commit check below needs ACTION_SHA's commit and its ACTION_VERSION tag

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
Expand Down Expand Up @@ -90,29 +89,39 @@ jobs:
exit 1
fi

# The installers generate a workflow pinned to `@v1`. If that tag predates
# scripts/settings.mjs and scripts/report.mjs, every new user gets working
# reviews with a silently inert Settings tab and empty Analytics — no
# error, just two dead console tabs. Refuse to ship an installer into that.
- name: Verify the v1 tag can serve what the installer generates
# The installers generate a workflow pinned to ACTION_SHA (with
# ACTION_VERSION in a comment) — never to a movable tag. Refuse to ship an
# installer that pins a commit which is not a tagged release, or which
# predates scripts/settings.mjs and scripts/report.mjs (every new user
# would get working reviews with a silently inert Settings tab and empty
# Analytics).
- name: Verify the pinned action commit can serve what the installer generates
if: steps.check.outputs.needed == 'true'
run: |
set -euo pipefail
if ! git rev-parse -q --verify refs/tags/v1 >/dev/null; then
echo "::error::No v1 tag. The generated workflow pins @v1 — see RELEASE.md."
SHA=$(node --input-type=module -e 'const m = await import("./bin/orcacode-review.mjs"); console.log(m.ACTION_SHA)')
VER=$(node --input-type=module -e 'const m = await import("./bin/orcacode-review.mjs"); console.log(m.ACTION_VERSION)')
if ! git cat-file -e "$SHA^{commit}" 2>/dev/null; then
echo "::error::ACTION_SHA $SHA is not a commit in this repository — see RELEASE.md."
exit 1
fi
if [ "$(git rev-parse -q --verify "refs/tags/$VER^{commit}" || true)" != "$SHA" ]; then
echo "::error::ACTION_SHA $SHA is not the commit tagged $VER — tag the release first (RELEASE.md)."
exit 1
fi
for f in scripts/settings.mjs scripts/report.mjs; do
if ! git cat-file -e "v1:$f" 2>/dev/null; then
echo "::error::v1 is missing $f. Move the v1 tag before publishing (RELEASE.md)."
if ! git cat-file -e "$SHA:$f" 2>/dev/null; then
echo "::error::the pinned commit $SHA is missing $f (RELEASE.md)."
exit 1
fi
done
echo "v1 = $(git rev-parse --short v1), ships settings.mjs and report.mjs"
echo "installer pins $VER = $SHA, which ships settings.mjs and report.mjs"

- name: Test
if: steps.check.outputs.needed == 'true'
run: node --test scripts/*.test.mjs
run: |
npm ci --ignore-scripts --no-audit --no-fund
node --test scripts/*.test.mjs

# A tarball that omits bin/ or skills/ still publishes cleanly and then
# fails on the user's first `npx`. Assert the payload before shipping it.
Expand Down Expand Up @@ -150,6 +159,18 @@ jobs:
console.log("tarball ok — " + files.length + " files");
'

# WHAT THE TARBALL SAYS ABOUT THE ACTION MUST BE TRUE OF THE PINNED RELEASE.
# The installer and the skill hand out ACTION_SHA; a README or skill page
# that names a newer action version (other than as the "from v1.x.y
# (unreleased)" marker the test suite holds unreleased behaviour to) would
# tell every npm user about behaviour their workflow does not have.
- name: Verify the published docs name no action version newer than the pin
if: steps.check.outputs.needed == 'true'
run: |
set -euo pipefail
npm pack --dry-run --json > "$RUNNER_TEMP/pack-docs.json"
node scripts/doc-pins.mjs --pack "$RUNNER_TEMP/pack-docs.json"

# Install the real tarball and run it through npm's real `.bin` shim.
#
# This exists because 1.0.0 shipped a CLI that did nothing. npm installs a
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/self-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
# Required so the local `uses: ./` action definition is present in the
# workspace. On pull_request, the default checkout is the PR merge ref, so
# `./` resolves to the action code being changed by the PR.
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: ./
with:
orcarouter-api-key: ${{ secrets.ORCAROUTER_API_KEY }}
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,19 @@ jobs:
matrix:
node-version: ["20", "24"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- uses: actions/setup-node@v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}

# Dev-only, exact-pinned: the YAML parser the structural tests read
# action.yml and the shipped workflows with, and the CommonMark + GFM
# renderer (micromark) the sanitizer is judged by. The action itself never
# installs them. `npm ci` installs exactly the lockfile (with its integrity
# hashes) and --ignore-scripts runs no install hook.
- run: npm ci --ignore-scripts --no-audit --no-fund

# Unquoted on purpose: the shell expands the glob into an explicit file
# list. `node --test` only gained native glob support in Node 21, so a
# quoted pattern would be read as a literal filename on the Node 20 leg.
Expand Down
77 changes: 70 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,47 @@ Configure your models, review mode, severity rules, merge policy, and other sett

[**Install OrcaCode Review from GitHub Marketplace →**](https://github.com/marketplace/actions/orca-code-review)

Add the Action to your repository:
Add this workflow as `.github/workflows/orca-code-review.yml` (or let `npx @orcarouter/code-review` write it). Use the whole file, not just the `uses:` step: the job's `if:` is what keeps the paid `/orcacode-review` command to maintainers, and the concurrency block is what stops any commenter from cancelling a running review. The action also refuses an outsider's command on its own, but the workflow is the first gate.

```yaml
- uses: Continuum-AI-Corp/orca-code-review@v1
with:
orcarouter-api-key: ${{ secrets.ORCAROUTER_API_KEY }}
name: OrcaCode Review

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, edited]
issue_comment:
types: [created]

permissions:
contents: read
pull-requests: write
issues: write
statuses: write # used from v1.7.0 (unreleased): the verdict on the PR head

jobs:
review:
runs-on: ubuntu-latest
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' }}
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 }}
```

The action is pinned to a release **commit**, with its version in the comment, rather than to a tag that can be moved: enable Dependabot's `github-actions` updates and each new release arrives as a reviewable PR. The full example, with every optional input, is [`workflows/orca-code-review.yml`](workflows/orca-code-review.yml).

### 3. Add your API key

Create or copy a key from [**OrcaRouter → API Keys**](https://www.orcarouter.ai/console/token).
Expand Down Expand Up @@ -216,7 +249,9 @@ Comment on any PR:
/orcacode-review
```

to request another review.
to request another review. Only an **owner, member or collaborator** can: the workflow's `if:` ignores the command from anyone else.

From v1.7.0 (unreleased) the action itself ignores an outsider's command too, whatever the workflow says, and the verdict lands on the PR's head commit as the `OrcaCode Review` status. On a PR **from a fork**, name the commit you looked at — `/orcacode-review <sha>`, at least 7 characters of it: the action reviews exactly that commit, and only while it is still the PR's head, so the fork cannot push something else in between. A bare command there, or a commit that is no longer the head, gets a reply with the current head and the command to use. Same-repository PRs keep the bare command.

---

Expand All @@ -226,13 +261,41 @@ To make P0/P1 findings actually prevent merging:

**GitHub → Settings → Branches / Rulesets → Require status checks to pass**

Add the **`review`** check as required.
Add the **`review`** check (the workflow's job) as required. An oversized diff fails it by default (`on-oversized-diff: "pass"` makes that advisory); a skipped review — on-demand mode, auto-review off, a draft, an author outside `auto-review-authors` — passes it with a notice on the PR.

From v1.7.0 (unreleased), the action also writes an **`OrcaCode Review`** commit status on the PR's head commit at the end of every run (grant `statuses: write`). It is green only when a review actually ran on that commit and the gate passed; a skipped review reads **"Not reviewed: …"**. Require that status instead of the `review` job once your workflow pins the release that writes it: it is the only check an on-demand `/orcacode-review` run can update on the PR (GitHub reports that run's own job check on the default branch), and it keeps an unreviewed PR from merging while the job stays green. `on-skipped-review: "fail"` fails the job on a skip too.

---

## Upgrading: what changes from v1.7.0 (unreleased)

Security hardening that changes what you may see. The installer, the example workflow and the quickstart above still pin **v1.6.0**, so none of this applies until you pin the release that ships it. Inputs are unchanged except for three new ones; defaults that close a hole are new.

| What changed | What you will notice | To keep the old behaviour |
| --- | --- | --- |
| `auto-review-authors` unset on a **public** repo now means `OWNER,MEMBER,COLLABORATOR` (private repos: everyone, as before) | Fork PRs from outsiders are no longer auto-reviewed on your wallet; a maintainer can `/orcacode-review` them | `auto-review-authors: "OWNER,MEMBER,COLLABORATOR,CONTRIBUTOR,FIRST_TIME_CONTRIBUTOR,FIRST_TIMER,MANNEQUIN,NONE"` (`"*"` works too from v1.7.0 (unreleased), but v1.6.0 reads it as nobody) |
| New `status-context` (default `"OrcaCode Review"`) | A commit status on the PR head after every run, on-demand runs included: green only for a reviewed head whose gate passed; a skipped review is **"Not reviewed"**. Grant `statuses: write`; require this status instead of the `review` job | `status-context: ""` |
| New `on-skipped-review` (default `"pass"`) | Nothing, by default: a skipped review still passes the job. `"fail"` fails the job on a skip too | — |
| New `bot-login` (default `""`) | Only for a custom GitHub App token: name its login (`"my-app[bot]"`) so the action recognises its earlier notices and edits them instead of posting new ones | — |
| Comment commands are checked by the action | `/orcacode-review` from anyone but an owner, member or collaborator, or any other comment, is a no-op | — |
| The pusher is checked, not only the author | A push to a fork PR by someone other than its author, who cannot write to your repository, is not auto-reviewed (the status says "Not reviewed"); a maintainer can `/orcacode-review` it | `auto-review-authors: "*"` |
| An allowlist of events | The action runs only on `pull_request` / `pull_request_target` (opened, synchronize, reopened, ready_for_review, a retargeting edit) and `issue_comment` (created); anything else — `pull_request_review`, `pull_request_review_comment`, a push — is a no-op that says why | — |
| A settings fetch that gets no settings — a 4xx (an ordinary, non-CI key gets one on every run) or an outage | The workflow's inputs apply for that run, exactly as with `settings: "false"`, and the log names the cause. `block-on` in the workflow is the outage floor: set it to what the dashboard enforces if an outage must not loosen the gate | — |
| The gate fails closed | A result the gate cannot read now fails the check instead of passing | — |
| `engine-version` must be pinned | Only versions with checksums in `scripts/engine-pins.json` install; anything else fails the run | — |
| `orcarouter-url` must be https | A plain-http gateway URL fails the run at its first step, with an error naming `orcarouter-url` and the fix (put TLS in front of a self-hosted gateway). Plain http stays allowed to this machine — `localhost`, `127.0.0.0/8`, `[::1]`. The settings fetch and the run report no longer send the key over plain http either | — |
| What is posted is sanitised | @mentions don't ping, HTML is shown as text, off-site links are shown as code, at most 50 findings are posted per review, guardrail details are hidden on public repos | — |
| The checkout is hardened | Symlinks are removed, the PR's `.gitattributes` cannot hide the diff, the base `.gitignore` applies; the summary lists changed files the engine skips. Lockfiles (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lockb`, `go.sum`, `Cargo.lock`, `poetry.lock`, `composer.lock`, `Gemfile.lock`, by file name) are not counted toward `max-diff-kb` / `max-diff-files`, so a dependency bump does not skip a PR; the summary lists them | — |
| Severity is never lowered | Duplicates keep the most severe tag; the judge cannot drop a P0 or a security finding | — |
| Shipped workflows | Per-job concurrency (a comment cannot cancel a running review; a newer comment replaces only a comment run still pending), re-run on `reopened` and on a retargeted base (`edited`), `statuses: write`, the action pinned to a commit SHA | Update your copy from [`workflows/orca-code-review.yml`](workflows/orca-code-review.yml) |

Self-hosted runners need git 2.31 or newer for private-repository fetches (the token travels in `GIT_CONFIG_*` environment variables, not on git's command line).

---

## Security & Privacy

OrcaCode reads the PR diff and repository files required for review. **It does not execute PR code.**
OrcaCode reads the PR diff and repository files required for review. **It does not execute PR code.** From v1.7.0 (unreleased), **the review engine never holds your API key** — an in-job proxy adds it on the way to OrcaRouter — and everything posted to the PR is sanitised and has your key and token redacted.

Optional run reporting sends only review metadata — repository, PR, commit SHA, tier, severity counts, gate result, and engine version.

Expand Down
Loading
Loading