mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 21:42:27 +08:00
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: GitHub 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 GitHub Content
|
|
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"}}' > package.json
|
|
npm install --no-package-lock
|
|
echo "NODE_PATH=/tmp/translation-deps/node_modules" >> $GITHUB_ENV
|
|
|
|
- name: 🌐 Run Translation Script
|
|
run: node scripts/github-translator.js
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
GITHUB_CONTEXT: ${{ toJSON(github) }}
|