Update Translations #175
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
# Licensed under https://github.com/wpilibsuite/frc-docs-translations/blob/main/license.txt | |
name: Update Translations | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- '.github/workflows/update-translations.yml' | |
- 'scripts/update.sh' | |
schedule: | |
- cron: '0 4,16 * * *' | |
jobs: | |
update-translations: | |
runs-on: ubuntu-latest | |
if: github.repository == 'FIRST-Tech-Challenge/ftcdocs-translations' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: 'true' | |
- name: Update Submodule | |
run: | | |
git submodule update --recursive --remote | |
- name: Install Transifex CLI | |
run: | | |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash | |
mv tx /usr/local/bin/tx | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.7' | |
cache: 'pip' | |
- name: Update wheel | |
run: | | |
pip install wheel==0.34.2 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- name: Update Translations | |
run: | | |
bash -l scripts/update.sh | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
- name: Lock Unused Transifex Resources | |
run: | | |
python scripts/lock-translations.py .tx/config | |
env: | |
TX_TOKEN: ${{ secrets.TX_TOKEN }} | |
- name: Create Commit & Push | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Update Translations from Transifex" | |
commit_user_name: GitHub | |
commit_user_email: [email protected] | |
commit_author: github-actions[bot] <00007350+github-actions[bot]@users.noreply.github.com> |