1
1
name : Pull Translations from Transifex
2
-
3
2
on :
4
3
schedule :
5
4
- cron : ' 0 * * * *'
@@ -14,13 +13,16 @@ jobs:
14
13
fail-fast : false
15
14
matrix :
16
15
version : [ '3.14' ]
16
+
17
17
steps :
18
18
- uses : styfle/cancel-workflow-action@main
19
19
with :
20
20
access_token : ${{ secrets.GITHUB_TOKEN }}
21
+
21
22
- uses : actions/setup-python@master
22
23
with :
23
24
python-version : 3
25
+
24
26
- name : Install Dependencies
25
27
run : |
26
28
sudo apt-get install -y gettext
@@ -29,28 +31,42 @@ jobs:
29
31
curl -O https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
30
32
chmod +x transifex-util.py
31
33
working-directory : /usr/local/bin
34
+
32
35
- uses : actions/checkout@master
33
36
with :
34
37
ref : ${{ matrix.version }}
35
38
fetch-depth : 0
39
+
36
40
- run : transifex-util.py recreate_tx_config --language hu --project-slug python-newest --version ${{ matrix.version }}
37
41
env :
38
42
TX_TOKEN : ${{ secrets.TX_TOKEN }}
43
+
39
44
- run : transifex-util.py fetch --language hu --project-slug python-newest --version ${{ matrix.version }}
40
45
env :
41
46
TX_TOKEN : ${{ secrets.TX_TOKEN }}
47
+
42
48
- run : transifex-util.py delete_obsolete_files --language hu --project-slug python-newest --version ${{ matrix.version }}
49
+
43
50
- name : Set up Git
44
51
run : |
45
52
git config --local user.email [email protected]
46
53
git config --local user.name "GitHub Action's update-translation job"
54
+
47
55
- name : Filter files
48
56
run : |
49
57
! git diff -I'^"POT-Creation-Date: ' \
50
58
-I'^"Language-Team: ' \
51
59
-I'^# ' -I'^"Last-Translator: ' \
52
60
--exit-code \
53
61
&& echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
62
+
54
63
- run : git add .
64
+
55
65
- run : git commit -m 'Update translation from Transifex'
56
- if : env.SIGNIFICANT_CHANGES
66
+ if : env.SIGNIFICANT_CHANGES
67
+
68
+ - uses : ad-m/github-push-action@master
69
+ if : env.SIGNIFICANT_CHANGES
70
+ with :
71
+ branch : ${{ matrix.version }}
72
+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments