|
1 | 1 | name: Translation |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_run: |
5 | | - workflows: |
6 | | - - Test |
7 | | - branches: |
8 | | - - main |
9 | | - types: |
10 | | - - completed |
| 4 | + workflow_run: |
| 5 | + workflows: |
| 6 | + - Test |
| 7 | + branches: |
| 8 | + - main |
| 9 | + types: |
| 10 | + - completed |
11 | 11 |
|
12 | 12 | env: |
13 | 13 | I18N_BRANCH: translation/source |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - build: |
17 | | - runs-on: ubuntu-latest |
| 16 | + build: |
| 17 | + runs-on: ubuntu-latest |
18 | 18 |
|
19 | | - steps: |
20 | | - - name: Grab the repo src |
21 | | - uses: actions/checkout@v2 |
22 | | - with: |
23 | | - fetch-depth: 0 # To reach the common commit |
24 | | - - name: Setup git user as [bot] |
25 | | - # Refs: |
26 | | - # * https://github.community/t/github-actions-bot-email-address/17204/6 |
27 | | - # * https://github.com/actions/checkout/issues/13#issuecomment-724415212 |
28 | | - uses: fregante/setup-git-user@v1.0.1 |
| 19 | + steps: |
| 20 | + - name: Grab the repo src |
| 21 | + uses: actions/checkout@v2 |
| 22 | + with: |
| 23 | + fetch-depth: 0 # To reach the common commit |
| 24 | + - name: Setup git user as [bot] |
| 25 | + # Refs: |
| 26 | + # * https://github.community/t/github-actions-bot-email-address/17204/6 |
| 27 | + # * https://github.com/actions/checkout/issues/13#issuecomment-724415212 |
| 28 | + uses: fregante/setup-git-user@v1.0.1 |
29 | 29 |
|
30 | | - - name: Switch to the translation source branch |
31 | | - run: | |
32 | | - sh -x |
| 30 | + - name: Switch to the translation source branch |
| 31 | + run: | |
| 32 | + sh -x |
33 | 33 |
|
34 | | - git fetch origin \ |
35 | | - '+refs/heads/${{ |
36 | | - env.I18N_BRANCH |
37 | | - }}:refs/remotes/origin/${{ |
38 | | - env.SRC_BRANCH |
39 | | - }}' |
| 34 | + git fetch origin \ |
| 35 | + '+refs/heads/${{ |
| 36 | + env.I18N_BRANCH |
| 37 | + }}:refs/remotes/origin/${{ |
| 38 | + env.SRC_BRANCH |
| 39 | + }}' |
40 | 40 |
|
41 | | - git checkout -B '${{ env.I18N_BRANCH }}' \ |
42 | | - 'origin/${{ env.I18N_BRANCH }}' |
| 41 | + git checkout -B '${{ env.I18N_BRANCH }}' \ |
| 42 | + 'origin/${{ env.I18N_BRANCH }}' |
43 | 43 |
|
44 | | - - name: >- |
45 | | - Merge '${{ github.event.repository.default_branch }}' |
46 | | - to '${{ env.I18N_BRANCH }}' |
47 | | - run: | |
48 | | - sh -x |
| 44 | + - name: >- |
| 45 | + Merge '${{ github.event.repository.default_branch }}' |
| 46 | + to '${{ env.I18N_BRANCH }}' |
| 47 | + run: | |
| 48 | + sh -x |
49 | 49 |
|
50 | | - git merge '${{ github.event.repository.default_branch }}' |
| 50 | + git merge '${{ github.event.repository.default_branch }}' |
51 | 51 |
|
52 | | - - name: Set up Python |
53 | | - uses: actions/setup-python@v2 |
54 | | - with: |
55 | | - python-version: >- |
56 | | - 3.10 |
| 52 | + - name: Set up Python |
| 53 | + uses: actions/setup-python@v2 |
| 54 | + with: |
| 55 | + python-version: >- |
| 56 | + 3.10 |
57 | 57 |
|
58 | | - - name: Install Python tooling |
59 | | - run: python -m pip install --upgrade nox virtualenv |
| 58 | + - name: Install Python tooling |
| 59 | + run: python -m pip install --upgrade nox virtualenv |
60 | 60 |
|
61 | | - - name: Generate a fresh POT file out of RST documents |
62 | | - run: python -m nox -s translation |
| 61 | + - name: Generate a fresh POT file out of RST documents |
| 62 | + run: python -m nox -s translation |
63 | 63 |
|
64 | | - - name: Commit the POT file to Git |
65 | | - run: | |
66 | | - git_hash=$(git rev-parse --short "${GITHUB_SHA}") |
67 | | - git add --force locales/messages.pot |
68 | | - git commit \ |
69 | | - -m "Update messages.pot as of version ${git_hash}" \ |
70 | | - locales/messages.pot |
| 64 | + - name: Commit the POT file to Git |
| 65 | + run: | |
| 66 | + git_hash=$(git rev-parse --short "${GITHUB_SHA}") |
| 67 | + git add --force locales/messages.pot |
| 68 | + git commit \ |
| 69 | + -m "Update messages.pot as of version ${git_hash}" \ |
| 70 | + locales/messages.pot |
71 | 71 |
|
72 | | - - name: >- |
73 | | - Push the updated POT file back to '${{ env.I18N_BRANCH }}' |
74 | | - branch on GitHub |
75 | | - if: always() |
76 | | - run: | |
77 | | - git push --atomic origin 'HEAD:${{ env.I18N_BRANCH }}' |
| 72 | + - name: >- |
| 73 | + Push the updated POT file back to '${{ env.I18N_BRANCH }}' |
| 74 | + branch on GitHub |
| 75 | + if: always() |
| 76 | + run: | |
| 77 | + git push --atomic origin 'HEAD:${{ env.I18N_BRANCH }}' |
0 commit comments