Skip to content

Commit 53c2806

Browse files
committed
release: Use PyPI Trusted Publishing
Instead of using the secret stored in environment secrets, allow the publish action to use the OIDC identity to authenticate to pypi.org. This repository/workflow/environment has been marked as a "Trusted Publisher" in pypi.org: this means PyPI should give the publish action a short lived token to use for publishing. This enables #2370: but the secret should still be removed before closing the issue (maybe after one successful release with Trusted Publishing). Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
1 parent 03a26b7 commit 53c2806

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
environment: release
9393
permissions:
9494
contents: write # to modify GitHub releases
95+
id-token: write # to authenticate as Trusted Publisher to pypi.org
9596
steps:
9697
- name: Fetch build artifacts
9798
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
@@ -103,9 +104,6 @@ jobs:
103104
# Only attempt pypi upload in upstream repository
104105
if: github.repository == 'theupdateframework/python-tuf'
105106
uses: pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d
106-
with:
107-
user: __token__
108-
password: ${{ secrets.PYPI_API_TOKEN }}
109107

110108
- name: Finalize GitHub release
111109
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410

0 commit comments

Comments
 (0)