Skip to content

Commit 798438b

Browse files
authored
Build(deps-dev): Bump frequenz-repo-config from 0.14.0 to 0.17.0 in the repo-config group across 1 directory (#128)
Bumps the repo-config group with 1 update in the / directory: [frequenz-repo-config](https://github.com/frequenz-floss/frequenz-repo-config-python). Updates `frequenz-repo-config` from 0.14.0 to 0.17.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/frequenz-floss/frequenz-repo-config-python/releases">frequenz-repo-config's releases</a>.</em></p> <blockquote> <h2>v0.17.0</h2> <h1>Frequenz Repository Configuration Release Notes</h1> <h2>Summary</h2> <p>This release improves workflows security, adds a black migration workflow, and fixes failed migrations from version v0.16.0.</p> <h2>Upgrading</h2> <h3>Cookiecutter template</h3> <p>All upgrading should be done via the migration script or regenerating the templates.</p> <pre lang="bash"><code>curl -sSLf https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/&lt;tag&gt;/cookiecutter/migrate.py | python3 -I </code></pre> <p>But you might still need to adapt your code:</p> <h2>New Features</h2> <h3>Cookiecutter template</h3> <ul> <li>Add a <code>black-migration.yaml</code> workflow that automatically reformats code when Dependabot upgrades <code>black</code>.</li> </ul> <h2>Bug Fixes</h2> <h3>Cookiecutter template</h3> <ul> <li>Fix migration of CI workflow matrices that used <code>arch</code>/<code>os</code> dimensions with values different from the default template. The v0.16.0 migration relied on exact string matching, so projects with customized matrix items (for example <code>arch: [amd64]</code>, <code>os: [ubuntu-24.04]</code>) could be left only partially migrated. The new migration step rebuilds the <code>platform</code> entries from the existing <code>arch</code>/<code>os</code> values and only rewrites <code>runs-on</code> when it still points to the old matrix keys.</li> <li>Improve workflows security: tighten permissions, avoid potential shell injection, run Python in isolated mode, pin all dependencies using the SHA hash.</li> </ul> <h2>What's Changed</h2> <ul> <li>Fix the cookiecutter migration script template by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/540">frequenz-floss/frequenz-repo-config-python#540</a></li> <li>build(deps): bump actions/create-github-app-token from 2.2.1 to 3.0.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/542">frequenz-floss/frequenz-repo-config-python#542</a></li> <li>build(deps): bump the patch group with 5 updates by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/543">frequenz-floss/frequenz-repo-config-python#543</a></li> <li>build(deps-dev): bump the minor group with 2 updates by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/544">frequenz-floss/frequenz-repo-config-python#544</a></li> <li>Reset release notes and migration script by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/539">frequenz-floss/frequenz-repo-config-python#539</a></li> <li>Improve workflows security by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/546">frequenz-floss/frequenz-repo-config-python#546</a></li> <li>build(deps-dev): bump mkdocs-material from 9.7.5 to 9.7.6 in the patch group by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/550">frequenz-floss/frequenz-repo-config-python#550</a></li> <li>build(deps-dev): bump setuptools-scm from 9.2.2 to 10.0.3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/552">frequenz-floss/frequenz-repo-config-python#552</a></li> <li>build(deps-dev): update sybil requirement from &lt;10,&gt;=6.1.1 to &gt;=6.1.1,&lt;11 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/553">frequenz-floss/frequenz-repo-config-python#553</a></li> <li>Add black auto-migration workflow by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/556">frequenz-floss/frequenz-repo-config-python#556</a></li> <li>Handle private repos in workflow migration by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/548">frequenz-floss/frequenz-repo-config-python#548</a></li> <li>migrate: Fix missed CI platform matrix migrations by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/549">frequenz-floss/frequenz-repo-config-python#549</a></li> <li>Remove chardet pinning by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/554">frequenz-floss/frequenz-repo-config-python#554</a></li> <li>Prepare for v0.17.0 release by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/557">frequenz-floss/frequenz-repo-config-python#557</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/5814b77ee5fad64a1125b0d638c673da807db606"><code>5814b77</code></a> Prepare for v0.17.0 release (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/557">#557</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/3d3a0de5f782c2ef0ff9f03ac3487297911410fd"><code>3d3a0de</code></a> template: Bump version to the upcoming v0.17.0</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/b8165c523898e123d1fd6808f48b0e2ed73f21c1"><code>b8165c5</code></a> Prepare release notes for the v0.17.0 release</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/9bc1d611219bd9b9a530c5100dc98b8bdae129bd"><code>9bc1d61</code></a> Fix wrong trailing quote in migration script</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/f12570061d57858c026d1af23c4efdbedb1c11d3"><code>f125700</code></a> Normalize tag comment</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/488c80c4e821c341f6f2193ce53fc47057f4e22e"><code>488c80c</code></a> Remove chardet pinning (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/554">#554</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/2ad88e7c5405645f1c92d52b04edbe8b11f3537b"><code>2ad88e7</code></a> migrate: Fix missed CI platform matrix migrations (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/549">#549</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/eec17e37ac99db594454a6119540e362b7456164"><code>eec17e3</code></a> Handle private repos in workflow migration (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/548">#548</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/ce994a3f765a0e9a58ab8aca6a0a5942c4067ce9"><code>ce994a3</code></a> Add black auto-migration workflow (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/556">#556</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/5800adfeff8f09ef92a41f02bc893211e5074506"><code>5800adf</code></a> Add release notes</li> <li>Additional commits viewable in <a href="https://github.com/frequenz-floss/frequenz-repo-config-python/compare/v0.14.0...v0.17.0">compare view</a></li> </ul> </details> <br />
2 parents b94493a + 40d9f33 commit 798438b

8 files changed

Lines changed: 139 additions & 69 deletions

File tree

.github/workflows/auto-dependabot.yaml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
11
name: Auto-merge Dependabot PR
22

33
on:
4-
pull_request:
4+
# XXX: !!! SECURITY WARNING !!!
5+
# pull_request_target has write access to the repo, and can read secrets. We
6+
# need to audit any external actions executed in this workflow and make sure no
7+
# checked out code is run (not even installing dependencies, as installing
8+
# dependencies usually can execute pre/post-install scripts). We should also
9+
# only use hashes to pick the action to execute (instead of tags or branches).
10+
# For more details read:
11+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
12+
pull_request_target:
513

614
permissions:
7-
contents: write
15+
# Read repository contents and Dependabot metadata used by the nested action.
16+
contents: read
17+
# The nested action also uses `github.token` internally for PR operations.
818
pull-requests: write
919

1020
jobs:
1121
auto-merge:
12-
if: github.actor == 'dependabot[bot]'
13-
runs-on: ubuntu-latest
22+
name: Auto-merge Dependabot PR
23+
if: >
24+
github.actor == 'dependabot[bot]' &&
25+
!contains(github.event.pull_request.title, 'the repo-config group') &&
26+
!contains(github.event.pull_request.title, 'Bump black from ')
27+
runs-on: ubuntu-slim
1428
steps:
29+
- name: Generate GitHub App token
30+
id: app-token
31+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
32+
with:
33+
app-id: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_ID }}
34+
private-key: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_PRIVATE_KEY }}
35+
# Merge Dependabot PRs.
36+
permission-contents: write
37+
# Create the auto-merged label if it does not exist.
38+
permission-issues: write
39+
# Approve PRs, add labels, and enable auto-merge.
40+
permission-pull-requests: write
41+
1542
- name: Auto-merge Dependabot PR
16-
uses: frequenz-floss/dependabot-auto-approve@e943399cc9d76fbb6d7faae446cd57301d110165 # v1.5.0
43+
uses: frequenz-floss/dependabot-auto-approve@e943399cc9d76fbb6d7faae446cd57301d110165 # v1.5.0
1744
with:
18-
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
github-token: ${{ steps.app-token.outputs.token }}
1946
dependency-type: 'all'
2047
auto-merge: 'true'
2148
merge-method: 'merge'

.github/workflows/ci-pr.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Test PR
33
on:
44
pull_request:
55

6+
permissions:
7+
# Read repository contents for checkout and dependency resolution only.
8+
contents: read
9+
610
env:
711
# Please make sure this version is included in the `matrix`, as the
812
# `matrix` section can't use `env`, so it must be entered manually
@@ -17,7 +21,7 @@ jobs:
1721

1822
steps:
1923
- name: Run nox
20-
uses: frequenz-floss/gh-action-nox@v1.1.1
24+
uses: frequenz-floss/gh-action-nox@e1351cf45e05e85afc1c79ab883e06322892d34c # v1.1.0
2125
with:
2226
python-version: "3.11"
2327
nox-session: ci_checks_max
@@ -27,15 +31,15 @@ jobs:
2731
runs-on: ubuntu-24.04
2832
steps:
2933
- name: Setup Git
30-
uses: frequenz-floss/gh-action-setup-git@v1.0.0
34+
uses: frequenz-floss/gh-action-setup-git@16952aac3ccc01d27412fe0dea3ea946530dcace # v1.0.0
3135

3236
- name: Fetch sources
33-
uses: actions/checkout@v6
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3438
with:
3539
submodules: true
3640

3741
- name: Setup Python
38-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.4
42+
uses: frequenz-floss/gh-action-setup-python-with-deps@0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 # v1.0.2
3943
with:
4044
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
4145
dependencies: .[dev-mkdocs]
@@ -44,11 +48,14 @@ jobs:
4448
env:
4549
MIKE_VERSION: gh-${{ github.job }}
4650
run: |
47-
mike deploy $MIKE_VERSION
48-
mike set-default $MIKE_VERSION
51+
# mike is installed as a console script, not a runnable module.
52+
# Run the installed script under isolated mode to avoid importing from
53+
# the workspace when building docs from checked-out code.
54+
python -I "$(command -v mike)" deploy "$MIKE_VERSION"
55+
python -I "$(command -v mike)" set-default "$MIKE_VERSION"
4956
5057
- name: Upload site
51-
uses: actions/upload-artifact@v7
58+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5259
with:
5360
name: docs-site
5461
path: site/

.github/workflows/ci.yaml

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
- 'dependabot/**'
1616
workflow_dispatch:
1717

18+
permissions:
19+
# Read repository contents for checkout and dependency resolution only.
20+
contents: read
21+
1822
env:
1923
# Please make sure this version is included in the `matrix`, as the
2024
# `matrix` section can't use `env`, so it must be entered manually
@@ -28,11 +32,9 @@ jobs:
2832
strategy:
2933
fail-fast: false
3034
matrix:
31-
arch:
32-
- amd64
33-
- arm
34-
os:
35+
platform:
3536
- ubuntu-24.04
37+
- ubuntu-24.04-arm
3638
python:
3739
- "3.11"
3840
- "3.12"
@@ -41,11 +43,11 @@ jobs:
4143
# that uses the same venv to run multiple linting sessions
4244
- "ci_checks_max"
4345
- "pytest_min"
44-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
46+
runs-on: ${{ matrix.platform }}
4547

4648
steps:
4749
- name: Run nox
48-
uses: frequenz-floss/gh-action-nox@v1.1.1
50+
uses: frequenz-floss/gh-action-nox@e1351cf45e05e85afc1c79ab883e06322892d34c # v1.1.0
4951
with:
5052
python-version: ${{ matrix.python }}
5153
nox-session: ${{ matrix.nox-session }}
@@ -60,7 +62,9 @@ jobs:
6062
needs: ["nox"]
6163
# We skip this job only if nox was also skipped
6264
if: always() && needs.nox.result != 'skipped'
63-
runs-on: ubuntu-24.04
65+
runs-on: ubuntu-slim
66+
# Drop token permissions: this job only checks matrix status from `needs`.
67+
permissions: {}
6468
env:
6569
DEPS_RESULT: ${{ needs.nox.result }}
6670
steps:
@@ -76,24 +80,24 @@ jobs:
7680

7781
steps:
7882
- name: Setup Git
79-
uses: frequenz-floss/gh-action-setup-git@v1.0.0
83+
uses: frequenz-floss/gh-action-setup-git@16952aac3ccc01d27412fe0dea3ea946530dcace # v1.0.0
8084

8185
- name: Fetch sources
82-
uses: actions/checkout@v6
86+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8387
with:
8488
submodules: true
8589

8690
- name: Setup Python
87-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.4
91+
uses: frequenz-floss/gh-action-setup-python-with-deps@0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 # v1.0.2
8892
with:
8993
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
9094
dependencies: build
9195

9296
- name: Build the source and binary distribution
93-
run: python -m build
97+
run: python -Im build
9498

9599
- name: Upload distribution files
96-
uses: actions/upload-artifact@v7
100+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
97101
with:
98102
name: dist-packages
99103
path: dist/
@@ -105,25 +109,23 @@ jobs:
105109
strategy:
106110
fail-fast: false
107111
matrix:
108-
arch:
109-
- amd64
110-
- arm
111-
os:
112+
platform:
112113
- ubuntu-24.04
114+
- ubuntu-24.04-arm
113115
python:
114116
- "3.11"
115117
- "3.12"
116-
runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}
118+
runs-on: ${{ matrix.platform }}
117119

118120
steps:
119121
- name: Setup Git
120-
uses: frequenz-floss/gh-action-setup-git@v1.0.0
122+
uses: frequenz-floss/gh-action-setup-git@16952aac3ccc01d27412fe0dea3ea946530dcace # v1.0.0
121123

122124
- name: Print environment (debug)
123125
run: env
124126

125127
- name: Download package
126-
uses: actions/download-artifact@v6
128+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
127129
with:
128130
name: dist-packages
129131
path: dist
@@ -143,13 +145,13 @@ jobs:
143145
> pyproject.toml
144146
145147
- name: Setup Python
146-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.4
148+
uses: frequenz-floss/gh-action-setup-python-with-deps@0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 # v1.0.2
147149
with:
148150
python-version: ${{ matrix.python }}
149151
dependencies: dist/*.whl
150152

151153
- name: Print installed packages (debug)
152-
run: python -m pip freeze
154+
run: python -Im pip freeze
153155

154156
# This job runs if all the `test-installation` matrix jobs ran and succeeded.
155157
# It is only used to have a single job that we can require in branch
@@ -161,7 +163,9 @@ jobs:
161163
needs: ["test-installation"]
162164
# We skip this job only if test-installation was also skipped
163165
if: always() && needs.test-installation.result != 'skipped'
164-
runs-on: ubuntu-24.04
166+
runs-on: ubuntu-slim
167+
# Drop token permissions: this job only checks matrix status from `needs`.
168+
permissions: {}
165169
env:
166170
DEPS_RESULT: ${{ needs.test-installation.result }}
167171
steps:
@@ -174,15 +178,15 @@ jobs:
174178
runs-on: ubuntu-24.04
175179
steps:
176180
- name: Setup Git
177-
uses: frequenz-floss/gh-action-setup-git@v1.0.0
181+
uses: frequenz-floss/gh-action-setup-git@16952aac3ccc01d27412fe0dea3ea946530dcace # v1.0.0
178182

179183
- name: Fetch sources
180-
uses: actions/checkout@v6
184+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
181185
with:
182186
submodules: true
183187

184188
- name: Setup Python
185-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.4
189+
uses: frequenz-floss/gh-action-setup-python-with-deps@0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 # v1.0.2
186190
with:
187191
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
188192
dependencies: .[dev-mkdocs]
@@ -191,11 +195,14 @@ jobs:
191195
env:
192196
MIKE_VERSION: gh-${{ github.job }}
193197
run: |
194-
mike deploy $MIKE_VERSION
195-
mike set-default $MIKE_VERSION
198+
# mike is installed as a console script, not a runnable module.
199+
# Run the installed script under isolated mode to avoid importing from
200+
# the workspace when building docs from checked-out code.
201+
python -I "$(command -v mike)" deploy "$MIKE_VERSION"
202+
python -I "$(command -v mike)" set-default "$MIKE_VERSION"
196203
197204
- name: Upload site
198-
uses: actions/upload-artifact@v7
205+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
199206
with:
200207
name: docs-site
201208
path: site/
@@ -207,18 +214,19 @@ jobs:
207214
if: github.event_name == 'push'
208215
runs-on: ubuntu-24.04
209216
permissions:
217+
# Push generated documentation updates to the `gh-pages` branch.
210218
contents: write
211219
steps:
212220
- name: Setup Git
213-
uses: frequenz-floss/gh-action-setup-git@v1.0.0
221+
uses: frequenz-floss/gh-action-setup-git@16952aac3ccc01d27412fe0dea3ea946530dcace # v1.0.0
214222

215223
- name: Fetch sources
216-
uses: actions/checkout@v6
224+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
217225
with:
218226
submodules: true
219227

220228
- name: Setup Python
221-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.4
229+
uses: frequenz-floss/gh-action-setup-python-with-deps@0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 # v1.0.2
222230
with:
223231
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
224232
dependencies: .[dev-mkdocs]
@@ -231,7 +239,7 @@ jobs:
231239
GIT_REF: ${{ github.ref }}
232240
GIT_SHA: ${{ github.sha }}
233241
run: |
234-
python -m frequenz.repo.config.cli.version.mike.info
242+
python -Im frequenz.repo.config.cli.version.mike.info
235243
236244
- name: Fetch the gh-pages branch
237245
if: steps.mike-version.outputs.version
@@ -252,13 +260,23 @@ jobs:
252260
GIT_REF: ${{ github.ref }}
253261
GIT_SHA: ${{ github.sha }}
254262
run: |
255-
mike deploy --update-aliases --title "$TITLE" "$VERSION" $ALIASES
263+
# Collect aliases into an array to avoid accidental (or malicious)
264+
# shell injection when passing them to mike.
265+
aliases=()
266+
if test -n "$ALIASES"; then
267+
read -r -a aliases <<<"$ALIASES"
268+
fi
269+
# mike is installed as a console script, not a runnable module.
270+
# Run the installed script under isolated mode to avoid importing from
271+
# the workspace when building docs from checked-out code.
272+
python -I "$(command -v mike)" \
273+
deploy --update-aliases --title "$TITLE" "$VERSION" "${aliases[@]}"
256274
257275
- name: Sort site versions
258276
if: steps.mike-version.outputs.version
259277
run: |
260278
git checkout gh-pages
261-
python -m frequenz.repo.config.cli.version.mike.sort versions.json
279+
python -Im frequenz.repo.config.cli.version.mike.sort versions.json
262280
git commit -a -m "Sort versions.json"
263281
264282
- name: Publish site
@@ -272,14 +290,12 @@ jobs:
272290
# Create a release only on tags creation
273291
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
274292
permissions:
275-
# We need write permissions on contents to create GitHub releases and on
276-
# discussions to create the release announcement in the discussion forums
293+
# Create GitHub releases and upload distribution artifacts.
277294
contents: write
278-
discussions: write
279-
runs-on: ubuntu-24.04
295+
runs-on: ubuntu-slim
280296
steps:
281297
- name: Download distribution files
282-
uses: actions/download-artifact@v6
298+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
283299
with:
284300
name: dist-packages
285301
path: dist
@@ -301,14 +317,14 @@ jobs:
301317
- name: Create GitHub release
302318
run: |
303319
set -ux
304-
extra_opts=
305-
if echo "$REF_NAME" | grep -- -; then extra_opts=" --prerelease"; fi
320+
extra_opts=()
321+
if echo "$REF_NAME" | grep -- -; then extra_opts+=(--prerelease); fi
306322
gh release create \
307323
-R "$REPOSITORY" \
308324
--notes-file RELEASE_NOTES.md \
309325
--generate-notes \
310-
$extra_opts \
311-
$REF_NAME \
326+
"${extra_opts[@]}" \
327+
"$REF_NAME" \
312328
dist/*
313329
env:
314330
REF_NAME: ${{ github.ref_name }}
@@ -325,10 +341,10 @@ jobs:
325341
id-token: write
326342
steps:
327343
- name: Download distribution files
328-
uses: actions/download-artifact@v6
344+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
329345
with:
330346
name: dist-packages
331347
path: dist
332348

333349
- name: Publish the Python distribution to PyPI
334-
uses: pypa/gh-action-pypi-publish@release/v1
350+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

0 commit comments

Comments
 (0)