-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.7 KB
/
chatgpt-revision.yaml
File metadata and controls
54 lines (53 loc) · 1.7 KB
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
name: chatgpt-revise
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to revise'
required: true
type: string
default: 'main'
file_names:
description: 'File names to revise'
required: false
type: string
default: ''
model:
description: 'Language model'
required: true
type: string
default: 'text-davinci-003'
branch_name:
description: 'Output branch'
required: true
type: string
default: 'ai-revision-davinci'
jobs:
chatgpt-revise:
name: GPT Revise
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Install Manubot AI Editor
run: bash ci/install-manuscript-editor.sh
- name: Revise manuscript
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AI_EDITOR_LANGUAGE_MODEL: ${{ inputs.model }}
AI_EDITOR_FILENAMES_TO_REVISE: ${{ inputs.file_names }}
# More variables can be specified to control the behavior of the model:
# https://github.com/greenelab/manubot-ai-editor/blob/main/libs/manubot/ai_editor/env_vars.py
run: python ci/run-manuscript-editor.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: 'GPT revised manuscript'
title: 'GPT (${{ inputs.model }}) used to revise manuscript'
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
add-paths: |
content/*.md
branch: ${{ inputs.branch_name }}
draft: true