Skip to content

Commit 635fbe2

Browse files
authored
Attest package provenance (#12333)
Use the new build provenance support added in [build-and-inspect-python-package 2.5.0](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md#250---2024-05-13). More information: https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/ Tested also in pytest-dev/pytest-mock#431. Note: even though it is technically necessary only for the `deploy` workflow, as the `test` workflow does not publish its packages, decided to always attest the provenance in both cases to avoid any surprises related to this (say a misconfiguration) when deploying.
1 parent fdf3aa3 commit 635fbe2

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,21 @@ jobs:
1919
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
2020
timeout-minutes: 10
2121

22+
# Required by attest-build-provenance-github.
23+
permissions:
24+
id-token: write
25+
attestations: write
26+
2227
steps:
2328
- uses: actions/checkout@v4
2429
with:
2530
fetch-depth: 0
2631
persist-credentials: false
2732

2833
- name: Build and Check Package
29-
uses: hynek/[email protected]
34+
uses: hynek/[email protected]
35+
with:
36+
attest-build-provenance-github: 'true'
3037

3138
deploy:
3239
if: github.repository == 'pytest-dev/pytest'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
fetch-depth: 0
3636
persist-credentials: false
3737
- name: Build and Check Package
38-
uses: hynek/build-and-inspect-python-package@v2.4.0
38+
uses: hynek/build-and-inspect-python-package@v2.5.0
3939

4040
build:
4141
needs: [package]

changelog/12333.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest releases are now attested using the recent `Artifact Attestation <https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/>` support from GitHub, allowing users to verify the provenance of pytest's sdist and wheel artifacts.

0 commit comments

Comments
 (0)