mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 23:59:45 +08:00
Create translator.yml
This commit is contained in:
parent
86e3776fff
commit
0121337ab3
51
.github/workflows/translator.yml
vendored
Normal file
51
.github/workflows/translator.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
name: Issue Translator
|
||||||
|
|
||||||
|
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:
|
||||||
|
issues:
|
||||||
|
types: [opened, edited]
|
||||||
|
issue_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
discussion:
|
||||||
|
types: [created, edited]
|
||||||
|
discussion_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, edited]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
translate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'CherryHQ/cherry-studio'
|
||||||
|
name: Auto Translate Issues and Comments
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
discussions: write
|
||||||
|
pull-requests: write
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 🐈⬛ Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: 📦 Setting Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: 📦 Install translation dependencies
|
||||||
|
run: |
|
||||||
|
mkdir -p /tmp/translation-deps
|
||||||
|
cd /tmp/translation-deps
|
||||||
|
echo '{"dependencies": {"openai": "^5.12.2", "@octokit/rest": "^21.0.0", "cli-progress": "^3.12.0", "tsx": "^4.20.3"}}' > package.json
|
||||||
|
npm install --no-package-lock
|
||||||
|
echo "NODE_PATH=/tmp/translation-deps/node_modules" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: 🌐 Translate Content
|
||||||
Loading…
Reference in New Issue
Block a user