mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-30 07:39:06 +08:00
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Auto I18N
|
|
|
|
env:
|
|
API_KEY: ${{ secrets.TRANSLATE_API_KEY}}
|
|
MODEL: ${{ vars.MODEL || 'deepseek/deepseek-v3.1'}}
|
|
BASE_URL: ${{ vars.BASE_URL || 'https://api.ppinfra.com/openai'}}
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
auto-i18n:
|
|
runs-on: ubuntu-latest
|
|
name: Auto I18N
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: 🐈⬛ Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: 📦 Setting Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: 📦 Dependencies
|
|
run: npm install openai cli-progress tsx
|
|
|
|
- name: 🏃♀️ Translate
|
|
run: tsx scripts/update-i18n.ts
|
|
|
|
- name: 🔄 Commit changes
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add .
|
|
git commit -m "fix: Auto update i18n locales from GitHub Actions"
|
|
|
|
- name: 🚀 Push changes
|
|
uses: ad-m/git-push@v1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: main
|