forked from databendlabs/databend-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.77 KB
/
v2.docs.translate.dir.yaml
File metadata and controls
58 lines (50 loc) · 1.77 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
55
56
57
58
name: GPT Translate by Input-V2
on:
workflow_dispatch:
inputs:
path:
description: "The path to the directory containing the files to translate (e.g., docs/en/sql-reference/)"
required: true
default: "docs/en/sql-reference/"
permissions:
id-token: write
pull-requests: write
checks: write
statuses: write
contents: write
jobs:
gpt_translate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Delete all files in specified cn directory
run: |
TRANSLATION_DIR="${{ github.event.inputs.path }}"
CN_DIR=$(echo $TRANSLATION_DIR | sed 's/en/cn/')
echo "Deleting all files in $CN_DIR"
rm -rf $CN_DIR
echo "All files in $CN_DIR have been deleted."
- name: Set up branch for PR
run: |
BRANCH_NAME="translate-${{ github.run_id }}"
git checkout -b $BRANCH_NAME
git push -u origin $BRANCH_NAME
- 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: "${{ github.event.inputs.path }}"
output_files: "docs/cn/**/*.{md,json}"
pr_title: "Add LLM Translations V2"