🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Refactor translation workflow to separate translation checks and manual triggers, enhancing clarity and automation. Update job names and permissions for improved workflow management.
Bill Yang88c95a6fb0a7
diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.ymlindex 13d3b08f1..4313776a6 100644--- a/.github/workflows/translate.yml+++ b/.github/workflows/translate.yml@@ -6,15 +6,15 @@ on:paths:- "client/src/**/*.ts"- "client/src/**/*.tsx"- workflow_dispatch: # Allow manual trigger+ workflow_dispatch:jobs:- translate:+ check:+ if: github.event_name == 'push'runs-on: ubuntu-latestpermissions:- contents: write- pull-requests: write- id-token: write+ actions: write+ contents: readsteps:- name: Checkout repositoryuses: actions/checkout@v4@@ -36,7 +36,6 @@ jobs:id: changesrun: |cd client/messages- # Check if any non-English file has empty string values or is missing keys from en.jsonEN_KEYS=$(python3 -c "import json; f=open('en.json'); d=json.load(f); print(len(d))")NEEDS_TRANSLATION=falsefor file in zh.json ja.json de.json pl.json pt.json it.json fr.json ko.json es.json; do@@ -49,9 +48,37 @@ jobs:doneecho "has_changes=$NEEDS_TRANSLATION" >> "$GITHUB_OUTPUT"- - name: Run Claude Code+ - name: Trigger translation workflowif: steps.changes.outputs.has_changes == 'true'- id: claude+ run: gh workflow run translate.yml --ref master+ env:+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}++ translate:+ if: github.event_name == 'workflow_dispatch'+ runs-on: ubuntu-latest+ permissions:+ contents: write+ pull-requests: write+ id-token: write+ steps:+ - name: Checkout repository+ uses: actions/checkout@v4+ with:+ fetch-depth: 1++ - name: Setup Node.js+ uses: actions/setup-node@v4+ with:+ node-version: 20++ - name: Install dependencies+ run: cd client && npm ci++ - name: Extract messages+ run: cd client && node scripts/extract-messages.mjs++ - name: Run Claude Codeuses: anthropics/claude-code-action@v1with:claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}