Skip to content

Commit 2e076ee

Browse files
authored
Update docs-commit.translate.yaml
1 parent ff59ad7 commit 2e076ee

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/docs-commit.translate.yaml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,25 @@ jobs:
3333
run: |
3434
echo "files=$(git diff --diff-filter=d --name-only HEAD^ HEAD | grep '\.md$' | grep -v 'cn' | sed -e 's/^/.\//' | tr '\n' ' ')" >> $GITHUB_OUTPUT
3535
36-
- name: Read prompt from file
37-
id: prompt
36+
- name: Set up branch for PR
3837
run: |
39-
echo 'prompt<<EOF' >> $GITHUB_OUTPUT
40-
cat .github/workflows/prompt.txt >> $GITHUB_OUTPUT
41-
echo 'EOF' >> $GITHUB_OUTPUT
38+
BRANCH_NAME="translate-${{ github.run_id }}"
39+
git checkout -b $BRANCH_NAME
40+
git push -u origin $BRANCH_NAME
4241
4342
- name: Run GPT Translate
44-
uses: 3ru/gpt-translate@v1.2.2
43+
uses: BohuTANG/gpt-translate-refine@v1.3.0
4544
with:
46-
apikey: ${{ secrets.API_KEY }}
47-
model: ${{ secrets.LLM_MODEL }}
48-
inputFiles: "${{ steps.changed_files.outputs.files }}"
49-
outputFiles: "docs/cn/**/*.md"
50-
languages: "Simplified-Chinese"
51-
prompt: "${{ steps.prompt.outputs.prompt }}"
52-
basePath: ${{ secrets.BASE_URL }}
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
api_key: ${{ secrets.API_KEY }}
47+
base_url: ${{ secrets.BASE_URL }}
48+
ai_model: ${{ secrets.LLM_MODEL }}
49+
refine_ai_model: ${{ secrets.REFINE_LLM_MODEL }}
50+
target_lang: "Simplified-Chinese"
51+
system_prompt: ".github/workflows/prompt.txt"
52+
refine_system_prompt: ".github/workflows/refine_prompt.txt"
53+
TEMPERATURE: ${{ secrets.TEMPERATURE }}
54+
REFINE_TEMPERATURE: ${{ secrets.REFINE_TEMPERATURE }}
55+
input_files: "${{ github.event.inputs.path }}"
56+
output_files: "docs/cn/**/*.{md,json}"
57+
commit_message: "Add LLM Translations V2"

0 commit comments

Comments
 (0)