-
Notifications
You must be signed in to change notification settings - Fork 42
51 lines (45 loc) · 1.53 KB
/
docs-commit.translate.yaml
File metadata and controls
51 lines (45 loc) · 1.53 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
name: GPT Translate per Commit
on:
push:
branches:
- main
paths-ignore:
- ".github**/*"
- "docs/cn/**/*"
- "docs/release-notes/**/*"
- "docs/fragment/**/*"
- "docs/release-stable/**/*"
- "api/**/*"
- "i18n/**/*"
- "src/**/*"
- "static/**/*"
- "types/**/*"
- "README.md"
jobs:
gpt_translate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository with two latest commits
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: get changed files name
id: changed_files
run: |
echo "files=$(git diff --diff-filter=d --name-only HEAD^ HEAD | grep '\.md$' | grep -v 'cn' | sed -e 's/^/.\//' | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Run GPT Translate
uses: BohuTANG/gpt-translate-refine@v1.4.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
api_key: ${{ secrets.API_KEY }}
base_url: ${{ secrets.BASE_URL }}
ai_model: ${{ secrets.LLM_MODEL }}
refine_ai_model: ${{ secrets.REFINE_LLM_MODEL }}
target_lang: "Simplified-Chinese"
system_prompt: ".github/workflows/prompt.txt"
refine_system_prompt: ".github/workflows/refine_prompt.txt"
temperature: ${{ secrets.TEMPERATURE }}
refine_temperature: ${{ secrets.REFINE_TEMPERATURE }}
input_files: "${{ steps.changed_files.outputs.files }}"
output_files: "docs/cn/**/*.{md,json}"
pr_title: "Add LLM Translations V2"