Skip to content

Commit 613b499

Browse files
committed
update workflows
1 parent 2a587cc commit 613b499

1 file changed

Lines changed: 29 additions & 17 deletions

File tree

‎.github/workflows/update.yml‎

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
1-
# Modification along rffontenelle/python-docs-pt-br
1+
# Adapted from python/python-docs-pt-br
2+
# Original (replaced update.yml): https://github.com/python/python-docs-pt-br/blob/main/.github/workflows/sync.yml
23
name: Update translations
34

45
on:
56
workflow_dispatch:
67
schedule:
78
- cron: '40 23 * * *'
8-
#push:
9-
# paths:
10-
# - '.github/workflows/update.yml'
11-
# - 'scripts/update.sh'
12-
# branches:
13-
# - '3.11'
9+
10+
permissions:
11+
contents: read
1412

1513
env:
16-
CPYTHON_BRANCH: '3.14'
14+
CPYTHON_BRANCH: '3.15'
1715
LANGUAGE: 'ja'
16+
TX_CLI_VERSION: '1.6.17'
1817

1918
jobs:
2019
update:
2120
# Job to pull translation from Transifex platform, and commit & push changes
2221
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
2324
steps:
2425
- name: Check out ${{ github.repository }}
25-
uses: actions/checkout@v4
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27+
with:
28+
ref: ${{ env.CPYTHON_BRANCH }}
2629
- name: Check out CPython
27-
uses: actions/checkout@v4
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2831
with:
2932
repository: python/cpython
3033
persist-credentials: false
3134
ref: ${{ env.CPYTHON_BRANCH }}
3235
path: cpython
3336
- name: Set up Python
34-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
3538
with:
39+
python-version: ${{ env.CPYTHON_BRANCH }}
40+
allow-prereleases: true
3641
cache: 'pip'
3742
cache-dependency-path: '**/requirements*.txt'
3843
- name: Install Transifex CLI
3944
run: |
40-
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
45+
curl -fsSL https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- "v${TX_CLI_VERSION}"
4146
working-directory: /usr/local/bin
4247
- name: Install dependencies
4348
run: |
@@ -69,24 +74,30 @@ jobs:
6974
needs: [update]
7075
strategy:
7176
matrix:
72-
branch: [ "3.13", "3.12", "3.11" ]
77+
branch: [ "3.14", "3.13", "3.12", "3.11" ]
7378

7479
runs-on: ubuntu-latest
80+
permissions:
81+
contents: write
7582
steps:
7683
- name: Check out source branch (${{ env.CPYTHON_BRANCH }})
77-
uses: actions/checkout@v4
84+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
7885
with:
86+
ref: ${{ env.CPYTHON_BRANCH }}
7987
path: ${{ env.CPYTHON_BRANCH }}
88+
persist-credentials: false
8089

8190
- name: Check out target branch (${{ matrix.branch }})
82-
uses: actions/checkout@v4
91+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8392
with:
8493
ref: ${{ matrix.branch }}
8594
path: ${{ matrix.branch }}
8695

8796
- name: Set up Python
88-
uses: actions/setup-python@v5
97+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
8998
with:
99+
python-version: ${{ env.CPYTHON_BRANCH }}
100+
allow-prereleases: true
90101
cache: 'pip'
91102
cache-dependency-path: '**/requirements*.txt'
92103

@@ -96,7 +107,9 @@ jobs:
96107
pip install pomerge powrap
97108
98109
- name: Merge overwriting on stable release branch
110+
shell: bash
99111
run: |
112+
shopt -s globstar nullglob
100113
pomerge --from "${{ env.CPYTHON_BRANCH }}"/**/*.po --to "${{ matrix.branch }}"/**/*.po
101114
102115
- name: Wrap catalog message files
@@ -112,4 +125,3 @@ jobs:
112125
git status
113126
git add -A
114127
git diff-index --quiet HEAD || ( git commit -m "Merge ${{ env.CPYTHON_BRANCH }} into ${{ matrix.branch }}" && git push )
115-

0 commit comments

Comments
 (0)