Skip to content

Commit d03e492

Browse files
committed
feat: add stable major action ref mode
1 parent 52cfce1 commit d03e492

6 files changed

Lines changed: 48 additions & 17 deletions

File tree

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ReviewRouter
22

3-
ReviewRouter is a GitHub Action for pull request review with Codex CLI OAuth, Codex CLI API-key mode, or OpenRouter.
3+
ReviewRouter is a GitHub Action for pull request review with Codex, OpenRouter, and experimental CLI providers for Claude Code, Gemini, and OpenCode.
4+
5+
The production-focused installer currently hardens the Codex and OpenRouter paths first. The other provider adapters are still available through `REVIEW_PROVIDERS`, but they are not yet the recommended zero-config setup path.
46

57
Current focus: a practical PR reviewer that can run from GitHub Actions, post a PR summary, post a small number of inline findings, and optionally fail the check on serious issues. The Codex path is designed to use a ChatGPT subscription OAuth login instead of OpenAI API billing.
68

@@ -22,13 +24,13 @@ The installer:
2224
- detects or asks for the target `owner/repo`;
2325
- lets you choose `github-actions[bot]` or GitHub App bot identity;
2426
- lets you choose Codex subscription OAuth, Codex CLI with OpenAI API key, or OpenRouter API key;
25-
- lets you choose a pinned latest release tag or live `main` for the generated workflow;
27+
- lets you choose stable `v1`, a pinned exact release tag, or live `main` for the generated workflow;
2628
- creates `.github/workflows/review-router.yml` on a setup branch;
2729
- opens a setup PR instead of pushing directly to the default branch.
2830

2931
See [docs/install.md](./docs/install.md) for organization-level secrets, selected repositories, GitHub App setup, and security notes.
3032

31-
By default, the generated workflow uses the latest release tag for stability. If you want a repository to always run the newest `main` code, set `REVIEW_ROUTER_ACTION_REF_MODE=main` when installing.
33+
By default, the generated workflow uses `777genius/review-router@v1`, a stable major tag that moves to the latest compatible v1 release. Use `REVIEW_ROUTER_ACTION_REF_MODE=release` for an exact pinned tag, or `REVIEW_ROUTER_ACTION_REF_MODE=main` for the live branch.
3234

3335
## Status
3436

@@ -47,7 +49,8 @@ What has been tested end-to-end:
4749
Available but still experimental:
4850

4951
- Multi-provider consensus beyond the simple one-provider Codex setup.
50-
- OpenAI API-key mode through Codex CLI and OpenRouter mode. The installer can generate these workflows, but the current hardened E2E path is Codex OAuth.
52+
- OpenAI API-key mode through Codex CLI and OpenRouter mode. The installer can generate these workflows, but the most hardened E2E path is Codex OAuth.
53+
- Claude Code, Gemini CLI, and OpenCode adapters. They exist in the engine, but still need the same read-only sandboxing, strict schema enforcement, env sanitization, installer credential setup, and real PR E2E coverage as the Codex path.
5154
- Code graph context on large mixed-language repos.
5255
- Analytics, learning, plugin, and self-hosted flows inherited from the upstream project.
5356

@@ -135,7 +138,7 @@ jobs:
135138
grep -q "codex-oauth-ok" /tmp/codex-smoke.txt
136139
137140
- name: Run ReviewRouter
138-
uses: 777genius/review-router@v1.0.1
141+
uses: 777genius/review-router@v1
139142
with:
140143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141144
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
@@ -165,7 +168,13 @@ FAIL_ON_MAJOR: 'true'
165168
166169
Then make `ReviewRouter / review` a required status check in branch protection.
167170

168-
If you intentionally want the live branch instead of the pinned release, use:
171+
If you want an exact pinned release instead of the auto-updating stable major tag, use:
172+
173+
```yaml
174+
uses: 777genius/review-router@v1.0.1
175+
```
176+
177+
If you intentionally want the live branch, use:
169178

170179
```yaml
171180
uses: 777genius/review-router@main

__tests__/e2e/install-script.e2e.test.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ describe('review-router curl installer e2e', () => {
5050

5151
const workflow = workflowText(result.workflowPath);
5252
expect(workflow).toContain('name: ReviewRouter');
53-
expect(workflow).toContain('uses: 777genius/review-router@v1.0.1');
54-
expect(result.stdout).toContain('Action ref: 777genius/review-router@v1.0.1');
53+
expect(workflow).toContain('uses: 777genius/review-router@v1');
54+
expect(result.stdout).toContain('Action ref: 777genius/review-router@v1');
5555
expect(workflow).toContain('GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}');
5656
expect(workflow).toContain('OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}');
5757
expect(workflow).toContain("INLINE_MAX_COMMENTS: '3'");
@@ -85,6 +85,21 @@ describe('review-router curl installer e2e', () => {
8585
expect(result.stdout).toContain('Action ref: 777genius/review-router@main');
8686
});
8787

88+
it('can generate an exact pinned release workflow when requested', () => {
89+
const result = runInstaller({
90+
REVIEW_ROUTER_IDENTITY: 'actions',
91+
REVIEW_ROUTER_AUTH: 'openrouter',
92+
REVIEW_ROUTER_PRESET: 'minimal',
93+
REVIEW_ROUTER_OPENROUTER_API_KEY: 'or-test-key',
94+
REVIEW_ROUTER_ACTION_REF_MODE: 'release',
95+
});
96+
97+
expect(result.status).toBe(0);
98+
const workflow = workflowText(result.workflowPath);
99+
expect(workflow).toContain('uses: 777genius/review-router@v1.0.1');
100+
expect(result.stdout).toContain('Action ref: 777genius/review-router@v1.0.1');
101+
});
102+
88103
it('keeps legacy AI_ROBOT_REVIEW environment aliases working', () => {
89104
const workdir = makeTempDir('airr-legacy-workdir-');
90105
const result = spawnSync('bash', [installerPath], {

docs/example-workflows/basic-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fetch-depth: 0
1818

1919
- name: ReviewRouter
20-
uses: 777genius/review-router@v1.0.1
20+
uses: 777genius/review-router@v1
2121
with:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
PR_NUMBER: ${{ github.event.pull_request.number }}

docs/github-app-review-bot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
permission-issues: write
5050
permission-pull-requests: write
5151

52-
- uses: 777genius/review-router@v1.0.1
52+
- uses: 777genius/review-router@v1
5353
with:
5454
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
5555
PR_NUMBER: ${{ github.event.pull_request.number }}

docs/install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ curl -fsSL https://raw.githubusercontent.com/777genius/review-router/main/script
88

99
The installer supports macOS and Linux shells first. It requires `gh`, `git`, and `curl`. GitHub App manifest setup uses `python3` when available; without `python3`, the installer prints manual App setup instructions.
1010

11-
The generated workflow uses the latest pinned release tag by default:
11+
The generated workflow uses the stable major tag by default:
1212

1313
```text
14-
777genius/review-router@v1.0.1
14+
777genius/review-router@v1
1515
```
1616

17-
Use `REVIEW_ROUTER_ACTION_REF_MODE=main` if you want the target repository to run the newest `main` branch on every workflow run. Use `REVIEW_ROUTER_ACTION_REF=owner/repo@ref` for a custom fork or exact commit SHA.
17+
`@v1` is moved to the latest compatible stable v1 release. Use `REVIEW_ROUTER_ACTION_REF_MODE=release` if you want the exact latest release tag pinned at install time, currently `777genius/review-router@v1.0.1`. Use `REVIEW_ROUTER_ACTION_REF_MODE=main` if you want the target repository to run the newest `main` branch on every workflow run. Use `REVIEW_ROUTER_ACTION_REF=owner/repo@ref` for a custom fork or exact commit SHA.
1818

1919
## Quick start
2020

scripts/install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ set -Eeuo pipefail
77

88
PRODUCT_NAME="review-router"
99
LATEST_RELEASE_TAG="v1.0.1"
10-
DEFAULT_ACTION_REF_MODE="release"
10+
LATEST_MAJOR_TAG="v1"
11+
DEFAULT_ACTION_REF_MODE="stable"
12+
DEFAULT_STABLE_ACTION_REF="777genius/review-router@$LATEST_MAJOR_TAG"
1113
DEFAULT_RELEASE_ACTION_REF="777genius/review-router@$LATEST_RELEASE_TAG"
1214
DEFAULT_MAIN_ACTION_REF="777genius/review-router@main"
1315
DEFAULT_BRANCH_NAME="review-router/setup"
@@ -335,7 +337,11 @@ resolve_action_ref() {
335337
fi
336338

337339
case "$ACTION_REF_MODE" in
338-
release|tag|stable|latest)
340+
stable|major|v1|latest)
341+
ACTION_REF_MODE="stable"
342+
ACTION_REF="$DEFAULT_STABLE_ACTION_REF"
343+
;;
344+
release|pinned|tag|exact)
339345
ACTION_REF_MODE="release"
340346
ACTION_REF="$DEFAULT_RELEASE_ACTION_REF"
341347
;;
@@ -344,7 +350,7 @@ resolve_action_ref() {
344350
ACTION_REF="$DEFAULT_MAIN_ACTION_REF"
345351
;;
346352
*)
347-
fatal "Unsupported REVIEW_ROUTER_ACTION_REF_MODE: $ACTION_REF_MODE. Use release, main, or REVIEW_ROUTER_ACTION_REF=owner/repo@ref."
353+
fatal "Unsupported REVIEW_ROUTER_ACTION_REF_MODE: $ACTION_REF_MODE. Use stable, release, main, or REVIEW_ROUTER_ACTION_REF=owner/repo@ref."
348354
;;
349355
esac
350356
}
@@ -1053,7 +1059,8 @@ main() {
10531059
normalize_secret_scope_env
10541060
if [ -z "$ACTION_REF_EXPLICIT" ] && [ -z "$ACTION_REF_MODE" ]; then
10551061
choose ACTION_REF_MODE "Action version" "$DEFAULT_ACTION_REF_MODE" \
1056-
"release:Pinned latest release tag ($LATEST_RELEASE_TAG), safest for most repositories" \
1062+
"stable:Stable major tag ($LATEST_MAJOR_TAG), receives compatible stable updates automatically" \
1063+
"release:Pinned exact release tag ($LATEST_RELEASE_TAG), maximum reproducibility" \
10571064
"main:Live main branch, gets every update immediately"
10581065
fi
10591066
resolve_action_ref

0 commit comments

Comments
 (0)