feat(ci): add dual-model PR Agent for automated code review
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
|||||||
|
name: PR Agent
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, ready_for_review, synchronize]
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
review-claude:
|
||||||
|
if: >
|
||||||
|
github.event_name == 'pull_request' ||
|
||||||
|
(github.event_name == 'issue_comment' &&
|
||||||
|
startsWith(github.event.comment.body, '/'))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: PR Agent - Claude Opus 4.7
|
||||||
|
uses: the-pr-agent/pr-agent@main
|
||||||
|
env:
|
||||||
|
OPENAI.KEY: ${{ secrets.PR_REVIEW_API_KEY }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
config.model: "openai/claude-opus-4-7"
|
||||||
|
config.fallback_models: '["openai/claude-opus-4-6"]'
|
||||||
|
config.custom_model_max_tokens: 200000
|
||||||
|
openai.api_base: ${{ secrets.PR_REVIEW_BASE_URL }}
|
||||||
|
github_action_config.auto_review: "true"
|
||||||
|
github_action_config.auto_describe: "true"
|
||||||
|
github_action_config.auto_improve: "true"
|
||||||
|
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "synchronize"]'
|
||||||
|
|
||||||
|
review-gpt:
|
||||||
|
if: >
|
||||||
|
github.event_name == 'pull_request' ||
|
||||||
|
(github.event_name == 'issue_comment' &&
|
||||||
|
startsWith(github.event.comment.body, '/'))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: PR Agent - GPT 5.5
|
||||||
|
uses: the-pr-agent/pr-agent@main
|
||||||
|
env:
|
||||||
|
OPENAI.KEY: ${{ secrets.PR_REVIEW_API_KEY }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
config.model: "openai/gpt-5.5"
|
||||||
|
config.fallback_models: '["openai/gpt-5.4-mini"]'
|
||||||
|
config.custom_model_max_tokens: 200000
|
||||||
|
openai.api_base: ${{ secrets.PR_REVIEW_BASE_URL }}
|
||||||
|
github_action_config.auto_review: "true"
|
||||||
|
github_action_config.auto_describe: "false"
|
||||||
|
github_action_config.auto_improve: "true"
|
||||||
|
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "synchronize"]'
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
[config]
|
||||||
|
ai_timeout = 300
|
||||||
|
temperature = 0.2
|
||||||
|
|
||||||
|
[pr_reviewer]
|
||||||
|
num_code_suggestions = 4
|
||||||
|
inline_code_comments = true
|
||||||
|
require_security_review = true
|
||||||
|
extra_instructions = """
|
||||||
|
This is a Next.js 16 / React 19 / TypeScript interactive visual novel engine.
|
||||||
|
Focus on: logic errors, security vulnerabilities, missing error handling,
|
||||||
|
type safety issues, and architectural violations.
|
||||||
|
Do not comment on code style or formatting.
|
||||||
|
"""
|
||||||
|
|
||||||
|
[pr_description]
|
||||||
|
generate_ai_title = true
|
||||||
|
publish_labels = true
|
||||||
|
use_bullet_points = true
|
||||||
|
|
||||||
|
[ignore]
|
||||||
|
glob = [
|
||||||
|
"pnpm-lock.yaml",
|
||||||
|
"*.generated.*",
|
||||||
|
"public/**",
|
||||||
|
"docs/**",
|
||||||
|
"*.md"
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user