This is a TypeScript, React, and Next.js showcase for
infiniumtek/code-review-agent.
It includes a demo website, a root review.toml, and a ready-to-adapt GitHub
Actions workflow.
npm install
npm run devOpen http://localhost:3000.
Useful checks:
npm run typecheck
npm run build-
Fork or clone the agent repository.
git clone https://github.com/infiniumtek/code-review-agent.git cd code-review-agent -
Build and publish the worker image.
docker login ghcr.io -u YOUR_GITHUB_USERNAME docker build -t ghcr.io/YOUR_GITHUB_ORG/code-review-agent:latest . docker push ghcr.io/YOUR_GITHUB_ORG/code-review-agent:latestMake the GHCR package readable by the repositories that will use it. If you publish it privately, the workflow may also need package read access.
-
Add an LLM API key to the repository being reviewed.
In GitHub, go to
Settings->Secrets and variables->Actions->New repository secret.Use one of these names:
OPENAI_API_KEYwithprovider: openaiANTHROPIC_API_KEYwithprovider: anthropicGOOGLE_API_KEYwithprovider: google
-
Add
review.tomlto the repository root.This demo already includes one. The important defaults are:
- CI and infra skills are enabled for Docker, GitHub Actions, GitLab CI, and Jenkins.
- generated files, lockfiles,
node_modules,dist,build, and.nextare ignored. fail_on = "high"fails the job on high or critical findings.
-
Add the workflow file.
This demo includes
.github/workflows/code-review-agent.yml. Replaceghcr.io/YOUR_GITHUB_ORG/code-review-agent:latestwith the image you published in step 2.The core workflow is:
name: Code Review Agent on: pull_request: types: [opened, synchronize, reopened, ready_for_review] permissions: contents: read pull-requests: write jobs: review: if: github.event.pull_request.draft == false runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: infiniumtek/code-review-agent/examples/github-action@main with: image: ghcr.io/YOUR_GITHUB_ORG/code-review-agent:latest provider: openai llm-api-key: ${{ secrets.OPENAI_API_KEY }} reporter: auto fail-on: high
For production, pin the action to a release tag or commit SHA instead of
@main. -
Open a pull request.
Push a branch that changes TypeScript, JavaScript, Dockerfile, or workflow files. The workflow checks out full history, runs the worker container against
BASE...HEAD, and passes the GitHub token to the reporter.
The agent creates PR comments through its github reporter. In GitHub Actions,
reporter: auto resolves to github plus terminal, so the workflow above is
enough.
To make PR comments work, keep these pieces in place:
permissions: pull-requests: writeactions/checkoutwithfetch-depth: 0llm-api-keywired to the selected provider secret- a reachable worker image in the
imageinput reporter: autoorreporter: github,terminal
The GitHub reporter does not create a fresh comment on every run. It looks for
its hidden marker, <!-- code-review-agent -->, and updates that same PR comment
in place. Re-running the workflow after new commits refreshes the existing
comment.
If no PR comment appears, check the Actions log first:
- external fork PRs may not receive repository secrets
- external fork PRs may receive a read-only
GITHUB_TOKEN - the GHCR image may be private or inaccessible
- missing
fetch-depth: 0can prevent the base SHA from being available fail-oncan fail the job when high or critical findings are found
Set fail-on: off for advisory-only reviews that should comment without
blocking merges.