1+ name :Pull Translations from Transifex
2+
3+ on :
4+ schedule :
5+ -cron :' 0 0 * * *'
6+ workflow_dispatch :
7+ permissions :
8+ contents :write
9+
10+ jobs :
11+ update-translation :
12+ runs-on :ubuntu-latest
13+ strategy :
14+ fail-fast :false
15+ matrix :
16+ version :[ '3.14' ]
17+ steps :
18+ -uses :styfle/cancel-workflow-action@main
19+ with :
20+ access_token :${{ secrets.GITHUB_TOKEN }}
21+ -uses :actions/setup-python@master
22+ with :
23+ python-version :3
24+ -name :Install Dependencies
25+ run :|
26+ sudo apt-get install -y gettext
27+ pip install requests cogapp polib transifex-python sphinx-intl blurb six
28+ curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
29+ curl -O https://raw.githubusercontent.com/python-docs-translations/transifex-automations/master/sample-workflows/transifex-util.py
30+ chmod +x transifex-util.py
31+ working-directory :/usr/local/bin
32+ -uses :actions/checkout@master
33+ with :
34+ ref :${{ matrix.version }}
35+ fetch-depth :0
36+ -run :transifex-util.py recreate_tx_config --language hu --project-slug python-newest --version ${{ matrix.version }}
37+ env :
38+ TX_TOKEN :${{ secrets.TX_TOKEN }}
39+ -run :transifex-util.py fetch --language hu --project-slug python-newest --version ${{ matrix.version }}
40+ env :
41+ TX_TOKEN :${{ secrets.TX_TOKEN }}
42+ -run :transifex-util.py delete_obsolete_files --language hu --project-slug python-newest --version ${{ matrix.version }}
43+ -name :Set up Git
44+ run :|
45+ git config --local user.email github-actions@github.com
46+ git config --local user.name "GitHub Action's update-translation job"
47+ -name :Filter files
48+ run :|
49+ ! git diff -I'^"POT-Creation-Date: ' \
50+ -I'^"Language-Team: ' \
51+ -I'^# ' -I'^"Last-Translator: ' \
52+ --exit-code \
53+ && echo "SIGNIFICANT_CHANGES=1" >> $GITHUB_ENV || exit 0
54+ -run :git add .
55+ -run :git commit -m 'Update translation from Transifex'
56+ if :env.SIGNIFICANT_CHANGES