Skip to content

Update transifex translations #207

Update transifex translations

Update transifex translations #207

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 3' # Every Wed at 06:00 UTC
name: Update transifex translations
jobs:
update_translations:
name: Update transifex translations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Install Python requirements
run: |
pip install --upgrade pip
# install requirements, excluding difficult to install ones
grep -Ev 'xmlsec|python3-saml' requirements/dev-requirements.txt > ../requirements.txt
pip install -r ../requirements.txt
- name: Install transifex client
run: |
mkdir -p /home/runner/.local/bin
cd /home/runner/.local/bin
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
sudo apt-get install -y gettext
- name: Configure transifex client
env:
TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}
run: |
# copy .transifexrc.example to ~/.transifexrc, edited to include token
grep -v '^token =' .transifexrc.example > ~/.transifexrc
echo "token = ${TRANSIFEX_TOKEN}" >> ~/.transifexrc
- name: Run update-translations script
run: |
./scripts/update-translations.sh
env:
UPDATE_TRANSLATIONS_SKIP_GIT: 1
- name: Create Pull Request
# https://github.com/marketplace/actions/create-pull-request
# Pinned to the commit of https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.2
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
token: ${{ steps.generate-token.outputs.token }}
base: master
branch: create-pull-request/update-translations
branch-suffix: short-commit-hash
commit-message: |
Update translations
title: 'Update Translations'
labels: product/invisible
body: |
GitHub Actions automatically ran update-translations.sh and used [create-pull-request](https://github.com/peter-evans/create-pull-request) to open this pull request.