-
Notifications
You must be signed in to change notification settings - Fork 28
37 lines (33 loc) · 1.44 KB
/
ai-code-review.yml
File metadata and controls
37 lines (33 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: "AI Code Review"
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: AI Code Review
uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 阿里云百炼 API Key
OPENAI_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
# 百炼的 OpenAI 兼容模式端点
OPENAI_API_ENDPOINT: "https://dashscope.aliyuncs.com/compatible-mode/v1"
# 指定百炼模型
MODEL: "qwen3-max"
# 设置语言为中文
LANGUAGE: "Chinese"
# 提示词优化:聚焦于实际问题,避免过度发散
PROMPT: "请用中文审查以下代码变更,**仅报告存在明确问题的代码**。重点关注:1) 明显的Bug(如空指针、数组越界、逻辑错误);2) 安全漏洞(如SQL注入、XSS);3) 严重性能问题(如死循环、内存泄漏);4) 并发安全问题(如数据竞争)。**如果代码没有明显问题,请简短回复'本次变更未发现明显问题',不要进行风格、命名或过度优化建议的评论。**"
# 只审查指定类型的文件(可选)
top_p: "1"
temperature: "0.3"
max_tokens: "10000"