Add GitHub Action to push source translation strings to Transifex

- requires TX_TOKEN secret to be set on GitHub
- you can generate a token at https://www.transifex.com/user/settings/api/
- `tx push` should fail silently if this is not provided
This commit is contained in:
Bryan Housel
2020-12-18 10:07:47 -05:00
parent bd3562d9a3
commit f3d6b3aeba

39
.github/workflows/transifex.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
# This workflow will push the iD source strings to transifex
# - requires TX_TOKEN secret to be set on GitHub
# - you can generate a token at https://www.transifex.com/user/settings/api/
# - job should fail silently if no token provided
name: transifex
on:
push:
branches:
- develop
jobs:
transifex:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install transifex-client
- name: Create .transifexrc
uses: DamianReeves/write-file-action
with:
path: ${{env.home}}/.transifexrc
write-mode: overwrite
contents: |
[https://www.transifex.com]
api_hostname = https://api.transifex.com
hostname = https://www.transifex.com
password = ${{secrets.TX_TOKEN}}
username = api
- name: Push source strings to Transifex
run: tx push --source --no-interactive