Skip to content

Commit

Permalink
docs(attestations): fix example for GitLab CI/CD (pypi#17163)
Browse files Browse the repository at this point in the history
* docs(attestations): fix example for GitLab CI/CD

* docs(attestations): align aud passed to id with id_tokens aud

---------

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
  • Loading branch information
nejch and di authored Nov 25, 2024
1 parent 2763dad commit fc3d73a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/user/attestations/producing-attestations.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ Before uploading attestations to the index, please:
- python -m pip install -U twine id

# Retrieve the OIDC token from GitLab CI/CD, and exchange it for a PyPI API token
- oidc_token=$(python -m id PYPI)
- oidc_token=$(python -m id pypi)
# Replace "https://pypi.org/*" with "https://test.pypi.org/*" if uploading to TestPyPI
- resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\":\"${oidc_token}\"}")
- api_token=$(jq --raw-output '.token' <<< "${resp}")

# Upload to PyPI authenticating via the newly-minted token, including the generated attestations
# Add "--repository testpypi" if uploading to TestPyPI
- twine --verbose --attestations upload -u __token__ -p "${api_token}" python_pkg/dist/*
- twine upload --verbose --attestations -u __token__ -p "${api_token}" python_pkg/dist/*
```

Note how, compared with the [Trusted Publishing workflow][GitLab Trusted Publishing], it has the
Expand Down

0 comments on commit fc3d73a

Please sign in to comment.