name: Update Translations on: pull_request: paths: - '.tx/**' - '.github/workflows/translations-pull.yml' schedule: # Runs in the middle of each month starting a quarter (UTC) = two weeks after new strings are built - cron: '0 0 15 1,4,7,10 *' workflow_dispatch: jobs: translations: # Do not run the scheduled workflow on forks if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice' name: Pull languages runs-on: ubuntu-slim steps: - name: "Checkout repo" uses: actions/checkout@v6 - name: "Pull translated strings from Transifex" uses: transifex/cli-action@v2 with: # Used config file: https://github.com/Cockatrice/Cockatrice/blob/master/.tx/config # Docs: https://github.com/transifex/cli#pulling-files-from-transifex args: pull --force --all token: ${{ secrets.TX_TOKEN }} - name: "Create pull request" if: github.event_name != 'pull_request' id: create_pr uses: peter-evans/create-pull-request@v8 with: add-paths: | cockatrice/translations/*.ts oracle/translations/*.ts author: github-actions # owner of the commit body: | Pulled all translated strings from [Transifex][1]. --- *This PR is automatically generated and updated by the workflow at `.github/workflows/translations-pull.yml`. Review [action runs][2].*
*After merging, all new languages and translations are available in the next build.* [1]: https://explore.transifex.com/cockatrice/cockatrice/ [2]: https://github.com/Cockatrice/Cockatrice/actions/workflows/translations-pull.yml?query=branch%3Amaster branch: ci-update_translations commit-message: Update translation files delete-branch: true draft: false labels: | CI Translation title: 'Update translations' - name: "PR Status" if: github.event_name != 'pull_request' shell: bash env: STATUS: ${{ steps.create_pr.outputs.pull-request-operation }} run: | if [[ "$STATUS" == "none" ]]; then echo "PR #${{ steps.create_pr.outputs.pull-request-number }} unchanged!" >> $GITHUB_STEP_SUMMARY else echo "PR #${{ steps.create_pr.outputs.pull-request-number }} $STATUS!" >> $GITHUB_STEP_SUMMARY fi echo "URL: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY