forked from suarezafelipe/GPTReviewWorkflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
63 lines (63 loc) · 1.96 KB
/
action.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: 'GPT4ReviewWorkflow'
description: 'GPT-4 reviews your PR'
branding:
icon: 'eye'
color: 'gray-dark'
inputs:
GIT_COMMIT_HASH:
description: 'SHA of the pull request-head to attach a review comment'
required: true
GIT_PATCH_OUTPUT:
description: 'The pull request in patch format for prompt interpretation'
required: true
GITHUB_TOKEN:
description: 'Derivative token for using the GitHub REST API'
required: true
OPENAI_API_KEY:
description: 'OpenAI API Key'
required: true
OPENAI_ORG_KEY:
description: 'OpenAI Organization ID'
required: true
PR_NUMBER:
description: 'The pull request id (ie: 17)'
required: true
PR_TITLE:
description: 'The pull request title'
required: true
REPOSITORY_NAME:
description: 'The repository name (ie: octocat/hello-world)'
required: true
runs:
using: "composite"
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install
shell: bash
run: |
sudo apt-get update
python3 -m venv .env2
source .env2/bin/activate
python -m pip install -U pip
pip install openai
pip install requests
- name: Fetch review logic
uses: wei/wget@v1
with:
args: -O review.py https://raw.githubusercontent.com/sheenhx/GPT4ReviewWorkflow/chunk/review.py
- name: Review PR and make comment
shell: bash
run: |
source .env2/bin/activate
python review.py
env:
GIT_COMMIT_HASH: ${{ inputs.GIT_COMMIT_HASH }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
LINK: "https://github.com/${{ inputs.REPOSITORY_NAME }}/pull/${{ inputs.PR_NUMBER }}"
OPENAI_API_KEY: ${{ inputs.OPENAI_API_KEY }}
OPENAI_ORG_KEY: ${{ inputs.OPENAI_ORG_KEY }}
PR_TITLE: ${{ inputs.PR_TITLE }}
GIT_PATCH_OUTPUT: ${{ inputs.GIT_PATCH_OUTPUT }}