-
Notifications
You must be signed in to change notification settings - Fork 76
40 lines (39 loc) · 2.2 KB
/
pr-writer.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
on:
pull_request:
types: [opened, reopened, ready_for_review]
issue_comment:
# Reply to an existing PR to generate description (commenter requires PR write access)
# Requires `/gpt-create-pr` commands to invoke
types: [created]
jobs:
llm-pr-generator:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
repository-projects: read
steps:
- name: Generate PR description using LLM
uses: smartcontractkit/.github/actions/llm-pr-writer@49c3554a9a6886f2ef9c7dc3aa6b1c99a54e3742 # points to a specific tag (ie. [email protected])
with:
# GitHub token used to fetch the PR diff and create a new PR comment.
# ${{ secrets.GITHUB_TOKEN }} will be sufficient.
gh-token: ${{ secrets.GITHUB_TOKEN }}
# OpenAI API Key, used to generate PR descriptions using the GPT model.
# Needs to have access to the chat-completion endpoints
# Example: ${{ secrets.OPENAI_API_KEY }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
# OpenAI model to use for PR description generation. Defaults to 'gpt-3.5-turbo-0125'.
# If your repository contains complex logic or expects large diffs, use 'gpt-4-0125-preview' or newer.
# Learn more at: https://platform.openai.com/docs/models/overview
openai-model: "gpt-4-turbo-2024-04-09"
# File paths or patterns to exclude from the diff analysis. Use semicolons (;) to separate multiple paths.
# Example: 'poetry.lock;artifacts/*'
# WARNING: Not excluding build artifacts may result in a large diff that may exceed the GPT model's token limit.
exclude-paths: "**/package-lock.json;**/.gitignore;**/.npmignore;**/.prettierignore;**/yarn.lock;**/*.png;**/*.jpg;**/*.jpeg;**/*.gif;**/*.bmp;**/*.svg;**/*.webp;**/*.tiff;**/broadcast/**/*.json"
# Absolute file path to a markdown or text file to append to the PR message (checklist, etc.)
# Example: '.github/pull_request_append.md'
pr-append-file: ""
# ref to smartcontractkit/.github repository to load the prompt from. Defaults to main.
# Usually used during development.
workflow-ref: ""