forked from cirolini/genai-code-review
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
52 lines (52 loc) · 2.23 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
name: "ChatGPT GitHub Actions"
description: "This GitHub Action automates code review for pull requests using OpenAI's GPT models. By integrating this action into your CI/CD pipeline, it provides detailed, AI-generated reviews of your code directly within the PR comments. This tool helps maintain code quality, ensures adherence to best practices, and highlights potential improvements and bugs."
inputs:
openai_api_key: # id of input
description: 'OpenAI API Key'
required: true
default: ''
github_token: # id of input
description: 'Github API Key'
required: true
default: ''
github_pr_id: # id of input
description: 'Github PR ID'
required: true
default: ''
openai_model:
description: "The OpenAI model to use for generating responses. Examples: 'gpt-3.5-turbo', 'gpt-4'"
required: false
default: "gpt-3.5-turbo"
openai_temperature:
description: "The temperature for OpenAI responses. Controls the creativity of the responses. Higher values (e.g., 0.9) make output more random, while lower values (e.g., 0.1) make it more focused and deterministic."
required: false
default: "0.5"
openai_max_tokens:
description: "The maximum number of tokens to generate in the OpenAI response. Example: 1000"
required: false
default: "2048"
mode:
description: "The mode of operation for the action. Options: 'files' to review file changes, 'patch' to review the patch changes."
required: false
default: "files"
language:
description: "The language for the code review"
required: false
default: "en" # English as the default language
custom_prompt:
description: "Custom prompt to use for generating responses. If not provided, a default prompt will be used based on the mode."
required: false
default: ""
runs:
using: "docker"
image: "Dockerfile"
env:
OPENAI_API_KEY: ${{ inputs.openai_api_key }}
GITHUB_TOKEN: ${{ inputs.github_token }}
GITHUB_PR_ID: ${{ inputs.github_pr_id }}
OPENAI_MODEL: ${{ inputs.openai_model }}
OPENAI_TEMPERATURE: ${{ inputs.openai_temperature }}
OPENAI_MAX_TOKENS: ${{ inputs.openai_max_tokens }}
MODE: ${{ inputs.mode }}
LANGUAGE: ${{ inputs.language }}
CUSTOM_PROMPT: ${{ inputs.custom_prompt }}