Skip to content

Commit c24d1e7

Browse files
committed
Use trusted publishing
In light of the recent npm supply chain attacks and also https://blog.pypi.org/posts/2025-09-16-github-actions-token-exfiltration/, I'm combing through our font stack to see if all them Py projects are using the trusted publisher mechanism as recommended by PyPI. See https://docs.pypi.org/trusted-publishers/ and https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi. Someone needs to do three things for this PR to work: * Create an environment called "publish-to-pypi" in this GitHub repository under Settings -> Environments. Creating alone is probably enough, no configuration needed I think. * Follow https://docs.pypi.org/trusted-publishers/adding-a-publisher/ to set up the other side on PyPI. * Remove tokens/secret variables here so they can't be exfiltrated anymore, and probably also remove them from PyPI. I'm not sure if one needs to do anything to make twine pick up the new creds, trusted publishing should be supported in v6.1.0.
1 parent 52edbe1 commit c24d1e7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
# ... and all build jobs completed successfully
5555
needs: [build_wheels]
5656
runs-on: ubuntu-latest
57+
environment:
58+
name: publish-to-pypi
59+
url: https://pypi.org/p/openstep-plist
60+
permissions:
61+
id-token: write # IMPORTANT: mandatory for trusted publishing.
62+
5763
steps:
5864
- uses: actions/checkout@v4
5965
with:
@@ -101,9 +107,6 @@ jobs:
101107
draft: false
102108
prerelease: ${{ env.IS_PRERELEASE }}
103109
- name: Build and publish
104-
env:
105-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
106-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
107110
run: |
108111
if [ "$IS_PRERELEASE" == true ]; then
109112
echo "DEBUG: This is a pre-release"

0 commit comments

Comments
 (0)