Skip to content

ci: only publish from tags that are on main - #316

Merged
jverce merged 2 commits into
mainfrom
fern/publish-only-from-main
Aug 18, 2026
Merged

ci: only publish from tags that are on main#316
jverce merged 2 commits into
mainfrom
fern/publish-only-from-main

Conversation

@fern-api

@fern-api fern-api Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why

Fern's SDK regeneration pipeline force-pushes a moving tag (fern-generation-base--fernapi--fern-python-sdk) that points at a synthetic commit which is not on main. Because the publish job in ci.yml currently runs on any pushed tag, these internal tags have been triggering unintended package releases (see the recent releases published without any merge to main).

What

Adds a guard to the publish job so it only publishes when the pushed tag points at a commit that is an ancestor of origin/main:

  • checkout with fetch-depth: 0 (full history, so origin/main is available)
  • a git merge-base --is-ancestor "$GITHUB_SHA" origin/main check whose output gates the remaining publish steps via if: — for any tag not on main (including the fern-generation-base--* tags) the publish steps are skipped and the job still succeeds

Normal release tags cut from main are unaffected.

We'd also recommend deleting the existing fern-generation-base--* tag in this repo and reviewing the package versions it published. A Fern-side fix to stop pushing these tags entirely is in progress; this is a defense-in-depth guard on the repo side.

@jverce
jverce merged commit 4e5c6e3 into main Aug 18, 2026
3 checks passed
@jverce
jverce deleted the fern/publish-only-from-main branch August 18, 2026 22:16
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.

1 participant