π§π· π³π± πΉπ Auto-Translate strings.xml #28
Workflow file for this run
This file contains hidden or 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: π§π· π³π± πΉπ Auto-Translate strings.xml | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - '**/values/strings.xml' | |
| workflow_dispatch: # allow manual trigger from GitHub UI | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| translate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.TRANSLATION_PAT_GHA_CLAUDE_JUL082026 }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install anthropic lxml requests | |
| - name: Run translation script | |
| env: | |
| ANTHROPIC_GH_API_KEY: ${{ secrets.ANTHROPIC_GH_API_KEY }} | |
| run: python scripts/translate_strings.py | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| git diff --quiet && echo "changed=false" >> $GITHUB_OUTPUT || echo "changed=true" >> $GITHUB_OUTPUT | |
| - name: Create branch and commit | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| BRANCH="translations/auto-$(date +%Y%m%d-%H%M%S)" | |
| echo "BRANCH=$BRANCH" >> $GITHUB_ENV | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$BRANCH" | |
| git add app/src/main/res/values-*/strings.xml | |
| git commit -m "chore(i18n): auto-translate missing strings [skip ci] | |
| Languages updated: ar, de, es, fa, fr, hi, in, it, ja, ko, nl, pa, pl, pt-rBR, ru, sv, th, tr, uk, zh-rCN, zh-rTW | |
| Triggered by: ${{ github.sha }} | |
| " | |
| git push origin "$BRANCH" | |
| - name: Open Pull Request | |
| if: steps.changes.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.TRANSLATION_PAT_GHA_CLAUDE_JUL082026 }} | |
| run: | | |
| gh pr create \ | |
| --title "π Auto-translations: missing strings updated" \ | |
| --body "$(cat /tmp/pr_body.md)" \ | |
| --base develop \ | |
| --head "$BRANCH" \ | |
| --label "translations" \ | |
| --reviewer "${{ github.actor }}" |