-
-
Notifications
You must be signed in to change notification settings - Fork 217
62 lines (61 loc) · 2.46 KB
/
update-translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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@b62528385c34dbc9f38e5f4225ac829252d1ea92
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/v4.1.2
uses: peter-evans/create-pull-request@171dd555b9ab6b18fa02519fdfacbb8bf671e1b4
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.