Skip to content

Commit 4c8fee2

Browse files
committed
ci(release): Migrate to PyPI Trusted Publisher
why: Improve security by eliminating stored API tokens and enable package attestations what: - Add OIDC permissions (id-token, attestations) to release job - Remove user/password authentication in favor of trusted publishing - Enable attestations for supply chain security - Fix deprecated skip_existing to skip-existing
1 parent 4df1128 commit 4c8fee2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ jobs:
9191
runs-on: ubuntu-latest
9292
needs: build
9393
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94+
permissions:
95+
id-token: write # Required for OIDC trusted publishing
96+
attestations: write # Required for generating attestations
9497

9598
strategy:
9699
matrix:
@@ -118,6 +121,5 @@ jobs:
118121
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
119122
uses: pypa/gh-action-pypi-publish@release/v1
120123
with:
121-
user: __token__
122-
password: ${{ secrets.PYPI_API_TOKEN }}
123-
skip_existing: true
124+
attestations: true
125+
skip-existing: true

0 commit comments

Comments
 (0)