Skip to content

ci: use PYPI_TOKEN for publishing and fix infinite generate loop#160

Merged
Aaron ("AJ") Steers (aaronsteers) merged 4 commits into
mainfrom
devin/1782171512-pypi-token-publish
Jun 23, 2026
Merged

ci: use PYPI_TOKEN for publishing and fix infinite generate loop#160
Aaron ("AJ") Steers (aaronsteers) merged 4 commits into
mainfrom
devin/1782171512-pypi-token-publish

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Three changes:

  1. PYPI_TOKEN for publishing: Switches publish.yml and pre-release-command.yml from OIDC trusted publishing (pypa/gh-action-pypi-publish + id-token: write) to uv publish with UV_PUBLISH_TOKEN. OIDC requires PyPI Owner access to configure, which is blocked pending ownership transfer.

  2. Fix infinite generate→merge loop: generate-command.yml restores .speakeasy/workflow.lock to HEAD before checking for changes. The codeSamplesRevisionDigest in this file is non-deterministic across runs, causing every generation to detect a diff, create a PR, auto-merge, and trigger another generation.

  3. Update schedule: Generation schedule changed from daily 6am UTC to 5am & 5pm Pacific (0 12 * * * and 0 0 * * *).

Link to Devin session: https://app.devin.ai/sessions/854c664803f3400387fdaa02e123b888
Requested by: Aaron ("AJ") Steers (@aaronsteers)

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits June 23, 2026 00:09
Switch from PyPI OIDC trusted publishing to PYPI_TOKEN secret.
OIDC requires PyPI Owner access to configure, which is currently blocked
pending ownership transfer. PYPI_TOKEN was already configured in the repo
from the v1 Speakeasy workflow.

Co-Authored-By: AJ Steers <aj@airbyte.io>
- Restore workflow.lock to HEAD before checking for changes to avoid
  non-deterministic codeSamplesRevisionDigest diffs triggering endless
  generate→merge loops
- Change schedule from daily 6am UTC to 5am & 5pm Pacific (12:00 & 00:00 UTC)

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration devin-ai-integration Bot force-pushed the devin/1782171512-pypi-token-publish branch from c3a2fda to fd1543f Compare June 23, 2026 00:10
@devin-ai-integration devin-ai-integration Bot changed the title ci: use PYPI_TOKEN for publishing instead of OIDC trusted publisher ci: use PYPI_TOKEN for publishing and fix infinite generate loop Jun 23, 2026
Comment thread .github/workflows/generate-command.yml Outdated
Co-Authored-By: AJ Steers <aj@airbyte.io>
Comment thread .github/workflows/generate-command.yml Outdated
Co-Authored-By: AJ Steers <aj@airbyte.io>
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review June 23, 2026 00:15
Copilot AI review requested due to automatic review settings June 23, 2026 00:16
@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit b21005b into main Jun 23, 2026
5 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1782171512-pypi-token-publish branch June 23, 2026 00:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates GitHub Actions workflows to publish the Python SDK to PyPI using a repository secret token (instead of OIDC trusted publishing), and adjusts the SDK generation workflow to avoid a non-deterministic lockfile change that can cause repeated auto-regen PRs.

Changes:

  • Switch PyPI publishing in release + pre-release workflows from pypa/gh-action-pypi-publish (OIDC) to uv publish using UV_PUBLISH_TOKEN from secrets.PYPI_TOKEN.
  • Prevent infinite generate→merge loops by restoring .speakeasy/workflow.lock to HEAD before checking for diffs.
  • Update the generation schedule to run twice daily.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/publish.yml Publish releases to PyPI via uv publish using PYPI_TOKEN-backed auth.
.github/workflows/pre-release-command.yml Publish pre-releases to PyPI via uv publish using PYPI_TOKEN-backed auth.
.github/workflows/generate-command.yml Avoids lockfile digest churn and updates the scheduled generation cadence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 32 to +36
schedule:
- cron: '0 6 * * *'
- cron: '0 5 * * *'
timezone: America/Los_Angeles
- cron: '0 17 * * *'
timezone: America/Los_Angeles
# Triggers:
# - On push to main: Auto-generates after every merge to ensure SDK stays up-to-date (auto-merge enabled)
# - Daily schedule (6 AM UTC): Catches upstream API spec changes (auto-merge enabled)
# - Daily schedule (5 AM & 5 PM America/Los_Angeles): Catches upstream API spec changes (auto-merge enabled)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Removal of GitHub environment protection for PyPI publishing

Both publish.yml and pre-release-command.yml previously declared environment: name: pypi which may have had GitHub environment protection rules (e.g., required reviewers, deployment branch restrictions). The PR removes these environment blocks entirely as part of the OIDC→token migration. If the pypi environment had protection rules configured in the repository settings, those guardrails are now bypassed. This is likely intentional since token-based auth doesn't require environment-scoped OIDC, but worth confirming that no protection rules are being lost.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines 34 to +37
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 CONTRIBUTING.md still references OIDC publishing after switch to PYPI_TOKEN

The PR changes both publish.yml and pre-release-command.yml from OIDC trusted publishing (pypa/gh-action-pypi-publish) to token-based publishing (uv publish with UV_PUBLISH_TOKEN), but CONTRIBUTING.md — a mandatory documentation file per AGENTS.md:25 — was not updated. It still says "published to PyPI via OIDC trusted publishing" at CONTRIBUTING.md:55 and "this triggers PyPI publication via OIDC" at CONTRIBUTING.md:78. Contributors and agents following this documentation will have an incorrect understanding of the publishing mechanism.

Prompt for agents
The PR changes the PyPI publishing mechanism from OIDC trusted publishing to token-based publishing using uv publish with PYPI_TOKEN. However, CONTRIBUTING.md was not updated to reflect this change. Two locations need to be fixed:

1. CONTRIBUTING.md line 55: Change "published to PyPI via OIDC trusted publishing" to "published to PyPI using a PYPI_TOKEN secret"
2. CONTRIBUTING.md line 78: Change "this triggers PyPI publication via OIDC" to "this triggers PyPI publication via PYPI_TOKEN"

The publish.yml header comment (line 4) was correctly updated to say "using PYPI_TOKEN" but the corresponding documentation file was missed.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

2 participants