AI Translate 54-query to Simplified-Chinese (#2461) #760
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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/[email protected] | |
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" |