Skip to content

Trusted Publishers doesn't accept JWTs from GitHub.com when iss customisation is enabled #17700

@unlobito

Description

@unlobito

Describe the bug

Using GitHub Actions on GitHub.com on an organisation that's customised the enterprise's issuer value causes PyPI to refuse release uploads with the reason:

  • invalid-payload: unknown trusted publishing issuer

Expected behavior

PyPI should accept JWTs from GitHub.com where iss customisation is enabled, or should allow specifying an enterprise slug when Adding a Trusted Publisher to an Existing PyPI project.

To Reproduce

  1. Follow https://docs.pypi.org/trusted-publishers/adding-a-publisher/ to use a Trusted Publisher for uploads to PyPI with GitHub Actions
  2. [Customise] the issuer value for an enterprise
  3. Observe a Trusted publishing exchange failure: https://github.com/Skyscanner/pycfmodel/actions/runs/13563626065

My Platform

pypa/gh-action-pypi-publish@release/v1 for GitHub Actions, on GitHub.com Enterprise Cloud

Additional context

Customizing the issuer value for an enterprise changes the OIDC JWT iss value for all repos/orgs in the enterprise to include the enterprise slug, which is often different from the organisation slug (and afaik can't be publicly determined).

For example, our iss value on https://github.com/Skyscanner changed from https://token.actions.githubusercontent.com to https://token.actions.githubusercontent.com/skyscanner.

Note these happen to have the same jwks_uri as uncustomised/regular JWTs from GitHub.com.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions