This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
50 lines (50 loc) · 1.7 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
name: 'OpenAI PR Description Generator'
author: "Antoine Barthelemy <antoine@linux.com>"
description: 'A GitHub Action that generates a PR description using OpenAI.'
branding:
icon: 'play'
color: 'black'
inputs:
model:
description: 'OpenAI model in use'
required: false
default: "text-davinci-003"
template:
description: 'PR content template for OpenAI to understand what must be in the pull request description'
required: false
default: ""
template-filepath:
description: 'Path to the PULL_REQUEST_TEMPLATE.md file'
required: false
default: ".github/PULL_REQUEST_TEMPLATE.md"
header:
description: 'Intro phrase giving context to the model'
required: false
default: "Based on the output of the command `git diff`, could you please generate a pull request description using the provided information? Be concise. Description must follow this format:\n"
api-key:
description: 'OpenAI API key'
required: true
default: ""
runs:
using: 'composite'
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Upgrade Pip
run: pip install --upgrade pip
shell: bash
- name: Install Dependencies
run: pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- name: Generate description
run: python ${{ github.action_path }}/src/main.py
shell: bash
env:
INPUT_TEMPLATE: ${{ inputs.template }}
INPUT_TEMPLATE_FILEPATH: ${{ inputs.template-filepath }}
INPUT_HEADER: ${{ inputs.header }}
INPUT_MODEL: ${{ inputs.model }}
OPENAI_API_KEY: ${{ inputs.api-key }}
GITHUB_BRANCH: ${{ github.head_ref }}