Skip to content

Commit cea4fc5

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 11e98ed commit cea4fc5

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
@@ -49,6 +49,9 @@ jobs:
4949
runs-on: ubuntu-latest
5050
needs: build
5151
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
52+
permissions:
53+
id-token: write
54+
attestations: write
5255

5356
strategy:
5457
matrix:
@@ -76,6 +79,5 @@ jobs:
7679
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
7780
uses: pypa/gh-action-pypi-publish@release/v1
7881
with:
79-
user: __token__
80-
password: ${{ secrets.PYPI_API_TOKEN }}
81-
skip_existing: true
82+
attestations: true
83+
skip-existing: true

0 commit comments

Comments
 (0)