1010 - pre-commit-ci-update-config # pre-commit.ci always creates a PR
1111 pull_request :
1212 workflow_call : # a way to embed the main tests
13+ secrets :
14+ CODECOV_TOKEN :
15+ required : true
1316
1417permissions :
1518 contents : read
@@ -112,6 +115,7 @@ jobs:
112115 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
113116 with :
114117 fetch-depth : 0
118+ persist-credentials : false
115119 - name : >-
116120 Calculate Python interpreter version hash value
117121 for use in the cache key
@@ -208,6 +212,8 @@ jobs:
208212 )
209213 - name : Set the target Git tag
210214 id : git-tag
215+ env :
216+ DIST_VERSION : ${{ steps.scm-version.outputs.dist-version }}
211217 run : |
212218 from os import environ
213219 from pathlib import Path
@@ -218,13 +224,13 @@ jobs:
218224 mode=FILE_APPEND_MODE,
219225 ) as outputs_file:
220226 print(
221- "tag=v${{
222- steps.scm-version.outputs.dist-version
223- }}",
227+ f"tag=v{environ['DIST_VERSION'].removeprefix('v')}",
224228 file=outputs_file,
225229 )
226230 - name : Set the expected dist artifact names
227231 id : artifact-name
232+ env :
233+ DIST_VERSION : ${{ steps.scm-version.outputs.dist-version }}
228234 run : |
229235 from os import environ
230236 from pathlib import Path
@@ -238,15 +244,11 @@ jobs:
238244 mode=FILE_APPEND_MODE,
239245 ) as outputs_file:
240246 print(
241- f"sdist={sdist_file_prj_base_name !s}-${{
242- steps.scm-version.outputs.dist-version
243- }}.tar.gz",
247+ f"sdist={sdist_file_prj_base_name !s}-{environ['DIST_VERSION']}.tar.gz",
244248 file=outputs_file,
245249 )
246250 print(
247- f"wheel={whl_file_prj_base_name !s}-${{
248- steps.scm-version.outputs.dist-version
249- }}-py3-none-any.whl",
251+ f"wheel={whl_file_prj_base_name !s}-{environ['DIST_VERSION']}-py3-none-any.whl",
250252 file=outputs_file,
251253 )
252254
@@ -268,7 +270,8 @@ jobs:
268270
269271 env :
270272 TOXENV : cleanup-dists,build-dists
271-
273+ SDIST_ARTIFACT_NAME : ${{ needs.pre-setup.outputs.sdist-artifact-name }}
274+ WHEEL_ARTIFACT_NAME : ${{ needs.pre-setup.outputs.wheel-artifact-name }}
272275 outputs :
273276 dists-base64-hash : ${{ steps.dist-hashes.outputs.combined-hash }}
274277
@@ -282,6 +285,7 @@ jobs:
282285 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
283286 with :
284287 fetch-depth : 0
288+ persist-credentials : false
285289
286290 - name : >-
287291 Calculate Python interpreter version hash value
@@ -357,19 +361,13 @@ jobs:
357361 --quiet
358362 - name : Verify that the artifacts with expected names got created
359363 run : >-
360- ls -1
361- 'dist/${{ needs.pre-setup.outputs.sdist-artifact-name }}'
362- 'dist/${{ needs.pre-setup.outputs.wheel-artifact-name }}'
364+ ls -1 "dist/${SDIST_ARTIFACT_NAME}" "dist/${WHEEL_ARTIFACT_NAME}"
363365 - name : Generate dist hashes to be used for provenance
364366 id : dist-hashes
365367 run : >-
366368 echo "combined-hash=$(
367- sha256sum
368- '${{ needs.pre-setup.outputs.sdist-artifact-name }}'
369- '${{ needs.pre-setup.outputs.wheel-artifact-name }}'
370- | base64 -w0
371- )"
372- >> "${GITHUB_OUTPUT}"
369+ sha256sum "$SDIST_ARTIFACT_NAME" "$WHEEL_ARTIFACT_NAME" | base64 -w0
370+ )" >> $GITHUB_OUTPUT
373371 working-directory : dist
374372 - name : Store the distribution packages
375373 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -386,7 +384,7 @@ jobs:
386384 retention-days : 30
387385
388386 lint :
389- name : 🧹 Linters${{ '' }} # nest jobs under the same sidebar category
387+ name : 🧹 Linters${{ '' }} # Group jobs in sidebar # zizmor: ignore[obfuscation]
390388 needs :
391389 - build
392390 - pre-setup # transitive, for accessing settings
@@ -444,7 +442,7 @@ jobs:
444442 codecov-token : ${{ secrets.CODECOV_TOKEN }}
445443
446444 tests :
447- name : 🧪 Tests${{ '' }} # nest jobs under the same sidebar category
445+ name : 🧪 Tests${{ '' }} # Group jobs in sidebar # zizmor: ignore[obfuscation]
448446 needs :
449447 - build
450448 - pre-setup # transitive, for accessing settings
0 commit comments