创建 cn.json #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Translations in PR | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update-translations: | |
timeout-minutes: 3 | |
permissions: | |
contents: write | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check if enabled | |
run: | | |
if [[ "${{ secrets.TRANSLATIONS_ACTION_IS_ENABLED }}" != "true" ]]; then | |
echo "Translation generation is disabled." | |
exit 1 | |
fi | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use bun | |
uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1.2.2 | |
- name: Install dependencies | |
run: | |
bun install | |
working-directory: packages/ui | |
- name: Update translations | |
env: | |
TRANSLATIONS_OPENAI_API_KEY: ${{ secrets.TRANSLATIONS_OPENAI_API_KEY }} | |
TRANSLATIONS_OPENAI_MODEL: ${{ secrets.TRANSLATIONS_OPENAI_MODEL }} | |
TRANSLATIONS_SYSTEM_PROMPT: ${{ secrets.TRANSLATIONS_SYSTEM_PROMPT }} | |
TRANSLATIONS_USER_PROMPT: ${{ secrets.TRANSLATIONS_USER_PROMPT }} | |
run: | | |
bun update-translations.js | |
rm -f bun.lockb | |
working-directory: packages/ui | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 | |
with: | |
commit_message: Update translations |