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