forked from qgis/QGIS-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (53 loc) · 2.07 KB
/
pofiles.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
63
64
65
66
67
name: Update English PO files for translation
on:
push:
branches:
- release_3.28
paths:
- 'docs/**'
schedule: #run at 02:00 UTC on Wednesday
- cron: '00 02 * * 03'
workflow_dispatch:
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
prepare_translation:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
if: github.repository_owner == 'qgis'
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
ref: release_3.28
- name: Set up Python 3.9
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-intl sphinxext.rediraffe pyYAML sphinx_togglebutton sphinx_copybutton
- name: Generate English PO files
id: "generate-po-files"
run: |
make gettext
sphinx-intl update -p build/gettext -l en
# Remove obsolete strings from the generated *.po files
find locale/en/LC_MESSAGES/docs/ -type f -name '*.po' -exec sed -i '/^#~ /,/^$/d' {} \;
- name: Commit the changes in the PO files
id: "auto-commit-action"
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
commit_message: Update English PO files
- name: "Inform that changes have been made"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes committed!"
- name: "Inform that no changes were performed"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No Changes detected!"