-
Notifications
You must be signed in to change notification settings - Fork 86
48 lines (41 loc) · 1.29 KB
/
push-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
name: push-translations
# Only run this when the main branch changes a markdown file or a top level config file
on:
push:
branches:
- master
paths:
- 'internal_use/docs/source/**.md'
- 'internal_use/docs/source/**.yml'
- '.github/workflows/push-translations.yml'
permissions:
contents: write
pull-requests: write
jobs:
push-translations:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install dependencies
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install sphinx-intl myst-parser
# Update the files
- name: Update the files
run: |
sphinx-build -b gettext internal_use/docs/source internal_use/docs/_build/gettext
- name: Push translations to a branch (branch protection)
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout -b auto_translation
git add "**.pot"
git commit -m "auto generated translation file updates"
git push -u origin auto_translation
gh pr create --title "Auto-translations" --body "Made by GH Actions"