Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 878d17f

Browse files
Start pulling from TX (#5)
1 parent ba3a6f3 commit 878d17f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/transifex-pull.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Pull Translations from Transifex
2-
32
on:
43
schedule:
54
- cron: '0 * * * *'
@@ -14,13 +13,16 @@ jobs:
1413
fail-fast: false
1514
matrix:
1615
version: [ '3.14' ]
16+
1717
steps:
1818
- uses: styfle/cancel-workflow-action@main
1919
with:
2020
access_token: ${{ secrets.GITHUB_TOKEN }}
21+
2122
- uses: actions/setup-python@master
2223
with:
2324
python-version: 3
25+
2426
- name: Install Dependencies
2527
run: |
2628
sudo apt-get install -y gettext
@@ -29,28 +31,42 @@ jobs:
2931
curl -O https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
3032
chmod +x transifex-util.py
3133
working-directory: /usr/local/bin
34+
3235
- uses: actions/checkout@master
3336
with:
3437
ref: ${{ matrix.version }}
3538
fetch-depth: 0
39+
3640
- run: transifex-util.py recreate_tx_config --language hu --project-slug python-newest --version ${{ matrix.version }}
3741
env:
3842
TX_TOKEN: ${{ secrets.TX_TOKEN }}
43+
3944
- run: transifex-util.py fetch --language hu --project-slug python-newest --version ${{ matrix.version }}
4045
env:
4146
TX_TOKEN: ${{ secrets.TX_TOKEN }}
47+
4248
- run: transifex-util.py delete_obsolete_files --language hu --project-slug python-newest --version ${{ matrix.version }}
49+
4350
- name: Set up Git
4451
run: |
4552
git config --local user.email [email protected]
4653
git config --local user.name "GitHub Action's update-translation job"
54+
4755
- name: Filter files
4856
run: |
4957
! git diff -I'^"POT-Creation-Date: ' \
5058
-I'^"Language-Team: ' \
5159
-I'^# ' -I'^"Last-Translator: ' \
5260
--exit-code \
5361
&& echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
62+
5463
- run: git add .
64+
5565
- 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

Comments
 (0)