You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: publish to PyPI with trusted publishing instead of PYPI_TOKEN - #1148
Moves PyPI publishing of openrouter from the long-lived PYPI_TOKEN to PyPI trusted publishing (OIDC).
.speakeasy/workflow.yaml: publish.pypi.token: $pypi_token → publish.pypi.useTrustedPublishing: true. sdk-gen-config supports this flag, and the pinned Speakeasy CLI is 1.787.0.
With the flag set, the pinned reusable sdk-publish.yaml@68f3bfe sets output use_pypi_trusted_publishing=true and skips its token-based publish-pypi job. It does not upload on its own, so sdk_publish.yaml gets a caller-side publish-pypi job. That job uses Speakeasy's own publish-pypi composite action at the same pin, which runs uv publish --trusted-publishing always dist/*. This matches the job that speakeasy configure publishing generates.
The new job gets only contents: read and id-token: write. The workflow-level permissions moved onto the publish job, with permissions: {} at the top, so the OIDC token is not available to other jobs. zizmor reports no new findings.
Removed pypi_token from all three workflows. The generation workflows run mode: pr and never publish.
Before merge (needs a PyPI owner of openrouter): go to pypi.org → openrouter → Publishing → add a GitHub trusted publisher: owner OpenRouterTeam, repo python-sdk, workflow sdk_publish.yaml, no environment. PyPI accepts tokens and OIDC side by side, so you can add the publisher at any time before merging.
After the first OIDC release succeeds: revoke the PyPI token and delete the PYPI_TOKEN repo secret.
Not verified until a real release: the end-to-end upload, which can't be exercised from a PR. scripts/publish.sh still references $PYPI_TOKEN, but it is a Speakeasy-generated file (tracked in gen.lock) and nothing calls it any more.
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
Disable automatic comment, CI, and merge conflict monitoring
Original prompt from Alex
SYSTEM:
<latest_message>
Alex Bujduveanu (U0BFFJD2XR8) [ts=1793074025.888729]: can this change be done entirely in a PR without git config chnages outside the PR?
publish tokens are long-lived. release.yaml publishes to npm with NPM_TOKEN, typescript-sdk uses NPM_TOKEN, python-sdk uses PYPI_TOKEN. litellm got hit in March because a token like this was readable from shared CI. fix: npm/PyPI trusted publishing (OIDC). ai-sdk-provider already does this.
</latest_message>
=== BEGIN THREAD HISTORY ===
Alex Bujduveanu (U0BFFJD2XR8) [ts=1793074025.888729]: can this change be done entirely in a PR without git config chnages outside the PR?
publish tokens are long-lived. release.yaml publishes to npm with NPM_TOKEN, typescript-sdk uses NPM_TOKEN, python-sdk uses PYPI_TOKEN. litellm got hit in March because a token like this was readable from shared CI. fix: npm/PyPI trusted publishing (OIDC). ai-sdk-provider already does this.
=== END THREAD HISTORY ===
Channel ID: D0BFEN3DLHK
Thread URL: https://openrouter.slack.com/archives/D0BFEN3DLHK/p1793074025888729?thread_ts=1793074025.888729&cid=D0BFEN3DLHK
The <latest_message> is the message that you should use to guide your goals + task for this session, and you should use the rest of the slack thread as context.
A [ts=...] marker on a Slack message is that message's timestamp. To act on a specific message with the slack tool (e.g. adding an emoji reaction via the reaction command), pass that value as timestamp along with the Channel ID — no extra lookup call is needed.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves PyPI publishing of
openrouterfrom the long-livedPYPI_TOKENto PyPI trusted publishing (OIDC)..speakeasy/workflow.yaml:publish.pypi.token: $pypi_token→publish.pypi.useTrustedPublishing: true. sdk-gen-config supports this flag, and the pinned Speakeasy CLI is1.787.0.sdk-publish.yaml@68f3bfesets outputuse_pypi_trusted_publishing=trueand skips its token-basedpublish-pypijob. It does not upload on its own, sosdk_publish.yamlgets a caller-sidepublish-pypijob. That job uses Speakeasy's ownpublish-pypicomposite action at the same pin, which runsuv publish --trusted-publishing always dist/*. This matches the job thatspeakeasy configure publishinggenerates.contents: readandid-token: write. The workflow-level permissions moved onto thepublishjob, withpermissions: {}at the top, so the OIDC token is not available to other jobs. zizmor reports no new findings.pypi_tokenfrom all three workflows. The generation workflows runmode: prand never publish.Before merge (needs a PyPI owner of
openrouter): go to pypi.org →openrouter→ Publishing → add a GitHub trusted publisher: ownerOpenRouterTeam, repopython-sdk, workflowsdk_publish.yaml, no environment. PyPI accepts tokens and OIDC side by side, so you can add the publisher at any time before merging.After the first OIDC release succeeds: revoke the PyPI token and delete the
PYPI_TOKENrepo secret.Not verified until a real release: the end-to-end upload, which can't be exercised from a PR.
scripts/publish.shstill references$PYPI_TOKEN, but it is a Speakeasy-generated file (tracked ingen.lock) and nothing calls it any more.Link to Devin session: https://openrouter.devinenterprise.com/sessions/ab9f8df32f544a1eae4412b551a5f4b4
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/ab9f8df32f544a1eae4412b551a5f4b4?variant=devin
Requested by: @alexb-openrouter