Browse Source

Only run Transifex if the TX_TOKEN is set

pull/1960/head
Safihre 4 years ago
parent
commit
86f77f8064
  1. 7
      .github/workflows/translations.yml

7
.github/workflows/translations.yml

@ -8,27 +8,30 @@ on:
jobs: jobs:
translations: translations:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Generate translatable texts - name: Generate translatable texts
run: | run: |
python3 tools/extract_pot.py python3 tools/extract_pot.py
- name: Install Transifex client - name: Install Transifex client
if: env.TX_TOKEN
# Sudo is needed to link the "tx"-command # Sudo is needed to link the "tx"-command
run: | run: |
sudo -H python3 -m pip install setuptools wheel sudo -H python3 -m pip install setuptools wheel
sudo -H python3 -m pip install transifex-client sudo -H python3 -m pip install transifex-client
- name: Push/pull Transifex translations - name: Push/pull Transifex translations
if: env.TX_TOKEN
run: | run: |
tx push --source --parallel tx push --source --parallel
tx pull --all --force --parallel tx pull --all --force --parallel
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Compile translations to validate them - name: Compile translations to validate them
run: | run: |
python3 tools/make_mo.py python3 tools/make_mo.py
- name: Push translatable and translated texts back to repo - name: Push translatable and translated texts back to repo
uses: stefanzweifel/git-auto-commit-action@v4.5.1 uses: stefanzweifel/git-auto-commit-action@v4.5.1
if: env.TX_TOKEN
with: with:
commit_message: Update translatable texts commit_message: Update translatable texts
commit_user_name: SABnzbd Automation commit_user_name: SABnzbd Automation

Loading…
Cancel
Save