Pull translations from transifex #1455
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: Pull translations from transifex | |
on: | |
schedule: | |
- cron: "0 9,21 * * *" # Run at 0am and 12pm GMT+3 | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
pull_translations: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Max fetch depth (full history of files) | |
- name: Install transifex client | |
run: | | |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash | |
- name: Pull translations | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
run: | | |
./tx pull --all --use-git-timestamps | |
- name: Get list of changed files | |
run: | | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "CHANGED<<$EOF" >> "$GITHUB_ENV" | |
git status --porcelain | head -10 >> "$GITHUB_ENV" | |
echo "$EOF" >> "$GITHUB_ENV" | |
- name: Push changes to the repository | |
uses: EndBug/[email protected] | |
with: | |
author_name: github-actions[bot] | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
message: | | |
Pull translations from transifex | |
Changed files (at most 10): | |
${{ env.CHANGED }} | |
trigger-translation-artifacts-autobuild: | |
runs-on: ubuntu-latest | |
needs: pull_translations | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.REPOSITORY_DISPATCH_PAT }} | |
repository: dfint/autobuild | |
event-type: update |