-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (29 loc) · 1.09 KB
/
test_action.yaml
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
name: Test Action
on:
pull_request:
branches: ["main"]
jobs:
chatgpt-pr-reviewer:
runs-on: ubuntu-latest
name: Use ChatGPT for PR review
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Review PR diff
id: chatgpt_pr_reviewer
uses: ./ # Uses an action in the root directory
# or use a released Github Action
# uses: osl-incubator/[email protected]
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
openai_model: 'gpt-4.0-turbo'
openai_temperature: 0.5
openai_max_tokens: 2048
openai_extra_criteria: | # optional, use `;` for separate the criteria items
- prefer readable variable name instead of short names like `k` and `v`, when apply;
- verify `SOLID` principles design pattern violations, when apply;
github_token: ${{ secrets.GITHUB_TOKEN }}
github_pr_id: ${{ github.event.number }}
- name: Print the result
run: |
echo "${{ steps.chatgpt_pr_reviewer.outputs.chatgpt_result }}"