Skip to content

Commit 060746e

Browse files
committed
pypi: Use trusted publishing (OIDC) (Gallopsled#2194)
Recently introduced [auth mechanism][1] makes it possible to not keep any long-lived tokens in GH secrets, reducing attack surface. [1]: https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ Cherry-picked from 74c3703
1 parent 0499631 commit 060746e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ jobs:
198198
pypi:
199199
runs-on: ubuntu-latest
200200
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
201+
permissions:
202+
id-token: write
201203
needs: test
202204
steps:
203205
- name: Download artifacts
@@ -207,10 +209,7 @@ jobs:
207209
path: dist
208210

209211
- name: Publish package
210-
uses: pypa/[email protected]
211-
with:
212-
user: __token__
213-
password: ${{ secrets.pypi_password }}
212+
uses: pypa/gh-action-pypi-publish@release/v1
214213

215214
- if: failure()
216215
run: ls -R

0 commit comments

Comments
 (0)