GitHub Actions based AI code review. The default setup uses OpenAI gpt-5.4-nano, Flex Processing, and a concise output contract that only reports actionable issues backed by diff evidence.
- Put this project in your repository.
- Add GitHub Actions secrets:
GH_TOKEN: GitHub PAT with repository read access and issue write access.OPENAI_KEY: OpenAI API key.
- Enable GitHub Actions.
- Push code. Review results are created as Issues with the
ai-code-reviewlabel.
OPENAI_BASE_URL is optional and defaults to https://api.openai.com/v1. Set it only for self-hosted or OpenAI-compatible providers.
- Push workflow reviews commits in the current repository.
- Scheduled workflow scans every repository accessible by
GH_TOKEN. - No
default_reposetting is needed. - No repository list is needed; unspecified means monitor all accessible repositories.
- Set
projects.enabled_reposonly when you want an allowlist. - If no actionable issue is found, the output is exactly:
未發現需要修改的問題。
config.json can be as small as:
{
"review": {
"response_language": "zh-TW"
}
}You can also remove config.json; built-in defaults will be used.
{
"model": {
"name": "gpt-5.4-nano",
"fallback_models": ["gpt-5.4-mini", "gpt-5.4"],
"api_mode": "responses",
"reasoning_effort": "medium",
"verbosity": "low",
"service_tier": "flex",
"max_tokens": 32768,
"timeout": 900
},
"projects": {
"enabled_repos": ["*"]
}
}temperature is intentionally not part of the default config. The OpenAI Responses API still documents sampling parameters, but GPT-5.4 review behavior is better controlled with reasoning_effort, verbosity, and a strict output contract.
service_tier defaults to flex, which is a good fit for asynchronous GitHub Actions review: lower cost, slower responses, and occasional resource unavailability. For higher reliability, use:
{
"model": {
"service_tier": "auto"
}
}Only set this when you do not want all accessible repositories monitored:
{
"projects": {
"enabled_repos": [
"owner/repo1",
"owner/repo2"
]
}
}Each actionable finding includes:
位置: file and line/hunk證據: concrete diff evidence影響: concrete failure mode修法: exact implementation direction驗證: command or test caseAI_AGENT_FIX_PROMPT: direct repair instruction for an AI coding agent
If there is no issue, the review does not invent one.
python3 scripts/test_config.pySee CONFIG.md.