Skip to content

feat: ai-code-review #1

feat: ai-code-review

feat: ai-code-review #1

Workflow file for this run

# https://github.com/anc95/ChatGPT-CodeReview/tree/main
name: Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
# if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
# Optional
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.deepseek.com/v1
MODEL: deepseek-chat
PROMPT: |
我将提供给你一段github pull request的file diff。请你扮演一位专业的开源社区开发者,帮我进行code review。
[[代码审核原则]]
[代码质量]
1. 该修改是否有必要,是否相比旧代码有改进或添加了新功能?
2. 是否有逻辑错误或潜在的运行时错误?
3. 是否有与其他代码部分的兼容性问题,会不会破坏与修改无关的现有逻辑?
4. 是否有可以优化的代码结构或逻辑,是否有更简洁或更高效的方式来实现相同功能?
5. 是否有潜在的性能问题?
[安全性]
1. 是否有敏感信息泄露的风险(如硬编码的密钥、密码等)?
2. 是否有可能运行来路不明的外部代码?
[[结果返回格式]]
如果发现任何问题或改进建议,请分点详细列出并说明;如果没有问题,请直接输出“LGTM”表示通过。
top_p: 1
temperature: 1.0
max_tokens: 8192
MAX_PATCH_LENGTH: # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
IGNORE_PATTERNS: # glob pattern or regex pattern to ignore files, separated by comma
INCLUDE_PATTERNS: # glob pattern or regex pattern to include files, separated by comma