Skip to content

Commit

Permalink
Attest package provenance
Browse files Browse the repository at this point in the history
This uses 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.
  • Loading branch information
nicoddemus authored May 16, 2024
1 parent fdf3aa3 commit 2812a61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
timeout-minutes: 10

# Required by attest-build-provenance-github.
permissions:
id-token: write
attestations: write

steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +31,9 @@ jobs:
persist-credentials: false

- name: Build and Check Package
uses: hynek/[email protected]
uses: hynek/[email protected]
with:
attest-build-provenance-github: 'true'

deploy:
if: github.repository == 'pytest-dev/pytest'
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ permissions: {}
jobs:
package:
runs-on: ubuntu-latest
# Required by attest-build-provenance-github.
permissions:
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/[email protected]
uses: hynek/[email protected]
with:
attest-build-provenance-github: 'true'

build:
needs: [package]
Expand Down

0 comments on commit 2812a61

Please sign in to comment.