Integration Guide · GitHub Actions
AI code review in GitHub Actions.
Put a six-agent review on every pull request. AI Council runs as an ordinary CI step with no GitHub App, bot account, or per-seat SaaS subscription, and its exit code decides whether the merge proceeds.
How it works
In CI mode, ai-council review diffs the pull request against the base branch, convenes the agents, and exits non-zero when the Council rules REJECT. Mark the job as a required status check and the ruling becomes enforceable: rejected code doesn't merge. Because it's a plain CLI, the same workflow works on GitHub, GitLab CI, or any runner with Node.js.
Step 1: Add repository secrets
Under Settings → Secrets and variables → Actions, add:
AI_COUNCIL_LICENSE_KEY: your license keyOPENAI_API_KEY: required (or use Gemini)GEMINI_API_KEY: optional but recommended; seats the Gemini Structural Thinker for a second model family's perspective
Step 2: Create the workflow
Add .github/workflows/ai-council.yml:
name: AI Council Review
on:
pull_request:
branches: [main, develop]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install AI Council
run: npm install -g @mugzie/ai-council
- name: Run Code Review
env:
AI_COUNCIL_LICENSE_KEY: ${{ secrets.AI_COUNCIL_LICENSE_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: ai-council review --diff --branch=origin/main --ci
fetch-depth: 0 matters: the Council needs full history to diff the PR against the base branch correctly.
Step 3: Make the ruling binding
Under Settings → Branches → Branch protection rules, add the review job as a required status check. From then on, a REJECT ruling blocks the merge until the code is revised.
Choosing models and controlling cost
You bring your own API keys, so review cost is exactly your providers' token pricing. There is no per-seat bot fee and no metered review credits. Two environment variables select the models:
AI_COUNCIL_MODEL: OpenAI model for most agents (defaultgpt-5.4-mini; usegpt-5.4for higher-quality rulings)AI_COUNCIL_GEMINI_MODEL: Gemini model for the structural thinker (defaultgemini-3.6-flash)
A typical PR review is a single Council session over the diff, a few cents with default models. See Configuration for the full variable reference.
What this looks like on a real diff
The Council's votes aren't rubber stamps. In this real session, five agents reviewed a 23-line bug fix and unanimously ruled REVISE, catching a response-parsing edge case and a proxy-compatibility risk the author missed.
Put a bench in your pipeline.
Every pull request argued, voted on, and ruled before a human reviewer spends a minute on it.