-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
49 lines (49 loc) · 1.55 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
name: "GPT Developer"
description: "An AI developer doing the work for you. It performs code changes based on GitHub issues. Warning: Experimental!"
icon: "code"
color: "blue"
inputs:
openai_api_key:
description: "OpenAI API key"
required: true
openai_model:
description: "OpenAI chat model to use, e.g. gpt-3.5-turbo or gpt-4. Defaults to gpt-3.5-turbo"
required: false
issue_number:
description: "So GPT can reference the issue number in the commit message"
required: true
issue_text:
description: "So GPT knows what needs to be done"
required: true
path:
description: "Path to the file that needs to be changed"
required: true
outputs:
commit_message:
description: "The commit message"
value: ${{ steps.gpt.outputs.commit_message }}
comment_message:
description: "The exit message, in case GPT thinks it needs to stop and let you know"
value: ${{ steps.gpt.outputs.comment_message }}
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install Python dependencies"
run: |
pip install openai
shell: bash
- name: "Install Prettier"
run: |
npm install -g prettier
shell: bash
- name: "Let GPT do the work"
id: gpt
run: |
python $GITHUB_ACTION_PATH/gpt.py "${{ inputs.openai_api_key }}" "${{ inputs.issue_number }}" "${{ inputs.issue_text }}" "${{ inputs.path }}"
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}