47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: PR-Agent
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, ready_for_review, synchronize]
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
jobs:
|
|
pr_agent_job:
|
|
if: ${{ github.event.sender.type != 'Bot' }}
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
issues: write
|
|
pull-requests: write
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Run PR Agent
|
|
uses: the-pr-agent/pr-agent@main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# 同时兼容 PR-Agent 旧写法和 OpenAI-like 新写法
|
|
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
|
|
OPENAI__KEY: ${{ secrets.OPENAI_KEY }}
|
|
OPENAI.API_BASE: "https://cpa.chris233.qzz.io/v1"
|
|
OPENAI__API_BASE: "https://cpa.chris233.qzz.io/v1"
|
|
|
|
# 中文输出
|
|
pr_reviewer.response_language: "zh-CN"
|
|
pr_description.response_language: "zh-CN"
|
|
pr_code_suggestions.response_language: "zh-CN"
|
|
|
|
# 模型配置
|
|
config.model: "openai/deepseek-v4-pro"
|
|
config.fallback_models: '["openai/gpt-5.4-mini"]'
|
|
config.custom_model_max_tokens: "1048576"
|
|
|
|
# 自动执行配置
|
|
github_action_config.auto_review: "true"
|
|
github_action_config.auto_describe: "true"
|
|
github_action_config.auto_improve: "false"
|
|
|
|
# 关键:允许 synchronize 事件触发 PR-Agent
|
|
github_action_config.pr_actions: '["opened", "reopened", "ready_for_review", "synchronize"]' |