Files
9router/.github/workflows/translate-readme.yml
2026-03-06 12:16:21 +07:00

41 lines
991 B
YAML

name: Translate README
on:
push:
branches:
- master
paths:
- 'README.md'
workflow_dispatch:
jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Translate README to all languages
env:
GLM_API_KEY: ${{ secrets.GLM_API_KEY }}
run: |
node .github/scripts/translate-readme.js vi zh-CN
- name: Commit translations
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add i18n/
git diff --staged --quiet || git commit -m "chore: auto-translate README to vi, zh-CN"
git push