11name :Pull Translations from Transifex
2-
32on :
43schedule :
54 -cron :' 0 * * * *'
@@ -14,13 +13,16 @@ jobs:
1413fail-fast :false
1514matrix :
1615version :[ '3.14' ]
16+
1717steps :
1818 -uses :styfle/cancel-workflow-action@main
1919with :
2020access_token :${{ secrets.GITHUB_TOKEN }}
21+
2122 -uses :actions/setup-python@master
2223with :
2324python-version :3
25+
2426 -name :Install Dependencies
2527run :|
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
3133working-directory :/usr/local/bin
34+
3235 -uses :actions/checkout@master
3336with :
3437ref :${{ matrix.version }}
3538fetch-depth :0
39+
3640 -run :transifex-util.py recreate_tx_config --language hu --project-slug python-newest --version ${{ matrix.version }}
3741env :
3842TX_TOKEN :${{ secrets.TX_TOKEN }}
43+
3944 -run :transifex-util.py fetch --language hu --project-slug python-newest --version ${{ matrix.version }}
4045env :
4146TX_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
4451run :|
4552 git config --local user.email github-actions@github.com
4653 git config --local user.name "GitHub Action's update-translation job"
54+
4755 -name :Filter files
4856run :|
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 }}