From d8d601ff5d838bd1be481e81a8aa2c66084cc8e6 Mon Sep 17 00:00:00 2001 From: Lawrence Date: Mon, 16 Mar 2026 22:24:27 +0000 Subject: [PATCH] Add auto-translate workflow for zh-CN This workflow automatically translates markdown files from English to Chinese (zh-CN) on pushes to the main branch. --- .github/workflows/auto-translate-zh.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/auto-translate-zh.yml diff --git a/.github/workflows/auto-translate-zh.yml b/.github/workflows/auto-translate-zh.yml new file mode 100644 index 00000000..62846e9d --- /dev/null +++ b/.github/workflows/auto-translate-zh.yml @@ -0,0 +1,38 @@ +name: Auto Translate to zh-CN + +on: + push: + branches: [main] + paths: + - "*.md" + +permissions: + contents: write + models: read + +jobs: + translate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/cache@v4 + with: + path: .genaiscript/cache/** + key: translation-cache-${{ github.run_id }} + restore-keys: translation-cache- + + - uses: pelikhan/action-continuous-translation@v0.2.11 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + source: en + lang: zh + files: "*.md;README.md;CONTRIBUTING.md;TRANSLATION_GUIDE.md;CLAUDE.md" + filename_template: "{{ base }}.zh-CN{{ ext }}" + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "docs(zh-CN): auto-translate updates" + file_pattern: "*.zh-CN.md"