ci: chat gpt code review (#1391)

This commit is contained in:
GaoNeng 2024-02-27 10:12:34 +08:00 committed by GitHub
parent ecbc2018d6
commit a278aec6ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 0 deletions

26
.github/workflows/gpt-ci.yaml vendored Normal file
View File

@ -0,0 +1,26 @@
name: GPT Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
Review:
if: ${{ contains(github.event.*.labels.*.name, 'gpt-review') }}
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
LANGUAGE: Chinese
PROMPT: ${{ secrets.PROMPT }}
max_tokens: ${{ secrets.MAX_TOKEN }}
top_p: 1
temperature: 1
MAX_PATCH_LENGTH: ${{ secrets.MAX_PATH_LENGTH }} # 当修改行数超过设定值后, 则不会请求gpt进行code review
MODEL: ${{ secrets.MODEL }} # https://platform.openai.com/docs/models