Skip to content

ci: switch PyPI publish workflow to Trusted Publishing#3296

Open
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:ci-pypi-trusted-publishing-3273
Open

ci: switch PyPI publish workflow to Trusted Publishing#3296
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:ci-pypi-trusted-publishing-3273

Conversation

@adityasingh2400
Copy link
Copy Markdown

Closes #3273.

Replace the rye PYPI_TOKEN environment variable with the pypa/gh-action-pypi-publish action and id-token: write permissions, so the workflow uploads via PyPI Trusted Publishing rather than a long-lived token. Other steps in publish-pypi.yml are unchanged.

After merge, the PyPI project will need a Trusted Publisher binding pointing at openai/openai-python and the publish-pypi.yml workflow name; happy to leave the action shape alone if maintainers prefer to set that up first.

@adityasingh2400 adityasingh2400 requested a review from a team as a code owner May 21, 2026 23:25
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a9f059168

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/publish-pypi.yml
Replace the rye PYPI_TOKEN env with the pypa/gh-action-pypi-publish
action and id-token: write permissions, so the workflow uploads via
PyPI Trusted Publishing rather than a long-lived token. Other steps
in publish-pypi.yml are unchanged.

After merge, the PyPI project will need a Trusted Publisher binding
pointing at openai/openai-python and the publish-pypi.yml workflow
name. Closes openai#3273.
@adityasingh2400 adityasingh2400 force-pushed the ci-pypi-trusted-publishing-3273 branch from 4a9f059 to 041f5bb Compare May 22, 2026 00:43
@adityasingh2400
Copy link
Copy Markdown
Author

Added contents: read to the job-level permissions block per Codex's suggestion. Keeps actions/checkout working on restricted enterprise mirrors while preserving Trusted Publishing's id-token: write scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Trusted Publishing to upload to PyPI

1 participant