Repository navigation
ci: publish only on release tags and verify tag matches version - #825
Open
fern-support wants to merge 1 commit into
Open
fern-support wants to merge 1 commit into
fern-support wants to merge 1 commit into
Conversation
Fern's `fern-generation-base--*` tag was triggering the publish job, uploading the version to PyPI before the release tag was pushed. The release tag run then failed with "File already exists" (7.3.0, 7.3.1). Also fail fast when the tag name doesn't match pyproject.toml, since `poetry publish --build` uses the pyproject version, not the tag (7.3.2 tag rebuilt and re-uploaded 7.3.1). Co-Authored-By: Claude <noreply@anthropic.com>
YuhengHuang-Cohere
approved these changes
Nov 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fern pushes
fern-generation-base--fernapi--fern-python-sdkduring regeneration, and that tag was triggering a real PyPI upload. When the release tag landed later, its run failed with400 File already exists. This happened for both 7.3.0 and 7.3.1.poetry publish --buildtakes the version frompyproject.toml, not the tag name. So bumping only the tag (7.3.2 → same commit as 7.3.1) rebuilt 7.3.1 and failed again.Evidence
Before:
fern-generation-base--*tag → publish ✅ (7.3.1 on PyPI 14:47 UTC)7.3.1tag → ❌File already exists ('cohere-7.3.1.tar.gz')7.3.2tag → ❌File already exists ('cohere-7.3.1.tar.gz')7.3.0tag → ❌ same pattern (Fern tag published it 43 min earlier)After:
fern-*tag → publish job skipped7.3.2tag on a commit where pyproject says7.3.1→ fails at "Verify tag matches package version" with a clear error, before anything is uploadedX.Y.Ztag matching pyproject → publishes as beforeThe new paths haven't run in CI yet; the YAML was checked by parsing it locally.
Merge Danger
Door: two-way
Revert restores the old trigger.
ci.ymlis in.fernignore, so Fern regeneration won't overwrite it.Blast Radius: releases
Publishing now happens only from the release tag. Releases need
pyproject.tomlto match the tag exactly (novprefix), which is true of all existing tags.Generated with Claude Code
Note
Medium Risk
Changes release automation and PyPI publishing gates; a misconfigured condition could skip or block legitimate releases, but behavior for matching release tags stays the same.
Overview
Tightens the publish job so PyPI uploads no longer run on Fern’s
fern-*regeneration tags—only on normal release tags—and adds a guard so the git tag must matchpoetry version --shortfrompyproject.tomlbeforepoetry publish --build.The publish
ifcondition now usesstartsWith(github.ref, 'refs/tags/')and explicitly excludesrefs/tags/fern-*, with comments documenting why. A new Verify tag matches package version step fails the job with a GitHub Actions error ifGITHUB_REF_NAMEand the package version differ, avoiding mistaken uploads when the tag name and built artifact version are out of sync.Reviewed by Cursor Bugbot for commit 989ae22. Bugbot is set up for automated code reviews on this repo. Configure here.