AI-powered code review for your GitHub pull requests, powered by Versed.
Versed analyzes your PR diff against your team's custom rules and posts a structured review comment directly on the pull request — including a pass/fail verdict, flagged issues by severity and file, and actionable suggestions.
Add this workflow file to your repository at .github/workflows/versed.yml:
name: Versed Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: Magnet-js/Versed-action@v1
with:
api_token: ${{ secrets.VERSED_API_TOKEN }}
repo_id: ${{ secrets.VERSED_REPO_ID }}- Sign up at useversed.com and connect your GitHub account.
- Register your repository and write a custom system prompt — your team's coding rules (e.g. "Enforce TypeScript strict mode. No
anytypes. Functions must not exceed 50 lines."). - Copy your API token and Repo ID from the Versed dashboard.
- Add them as secrets in your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Add
VERSED_API_TOKEN— your API token - Add
VERSED_REPO_ID— your Repo ID (a number shown in the dashboard)
- Add the workflow file shown in Quick Start to your repository.
| Input | Required | Default | Description |
|---|---|---|---|
api_token |
Yes | — | Your Versed API token. Store as a GitHub secret. |
repo_id |
Yes | — | Your Versed Repo ID (found in the dashboard). |
api_url |
No | https://api.useversed.com |
Versed API base URL. Only needed for self-hosted deployments. |
The action requires pull-requests: write to post and update the review comment. Declare this explicitly in your job:
jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write # requiredWithout this permission the action will fail with a 403 error when attempting to post the comment.
- Posts a placeholder comment on the PR immediately — so reviewers know a review is in progress.
- Fetches the PR diff via the GitHub API (up to 50,000 characters).
- Sends the diff and PR title to the Versed backend, which runs your custom rules through Gemini 2.5 Flash.
- Updates the comment with the full review: a pass/fail verdict, an issues table (severity · file · description), and a suggestions list.
## 🔍 Versed Code Review — ✅ Passed
The changes look good overall. One minor style issue was noted in the auth module.
### Issues
| Severity | File | Description |
|----------|------|-------------|
| WARNING | src/auth/token.ts | Function `validateToken` exceeds the 50-line limit |
### Suggestions
- Consider extracting the expiry check logic into a `isExpired` helper for reuse.
---
*Powered by Versed*
A failed review (any issue with severity error, critical, high, or blocker) shows ❌ Failed in the heading.
Pin to a major version tag for stability while still receiving patch updates:
- uses: Magnet-js/Versed-action@v1Or pin to an exact release for maximum reproducibility:
- uses: Magnet-js/[email protected]Using @main is not recommended in production as it may include unreleased changes.
MIT