fix(ci): stamp publish with resolved tag instead of releases/latest API#1136
Conversation
The stamp step queried the GitHub releases/latest API to get the version for the "Latest · vX.Y.Z" display name. On a tag push, the Release object may not exist yet, causing the stamp to show the previous version (e.g. "Latest · v0.13.0" on a v0.14.0 publish). Use the already-resolved tag from the earlier step instead — it's always correct since it comes from the trigger event itself. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThis pull request modifies the GitHub Actions workflow Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish-fern-docs.yml:
- Around line 203-208: The workflow currently overwrites the "Latest"
display-name using TAG (steps.resolve.outputs.tag), which can be a prerelease or
older tag; instead introduce a dedicated STAMP_TAG (e.g., export STAMP_TAG=${{
steps.resolve.outputs.tag }}), use STAMP_TAG in the yq update to write a
non-user-facing stamp field (for example set .products[0].versions[] |
select(.slug=="latest").stamp = env(STAMP_TAG)) or otherwise stamp artifacts
with STAMP_TAG, and stop changing .display-name for the "latest" version so
visible labels remain correct (leave .display-name as "Latest · " or unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 8dc37a1a-79cf-4067-ac66-7211d579b1e6
📒 Files selected for processing (1)
.github/workflows/publish-fern-docs.yml
|
Re: CodeRabbit's suggestion to introduce a Pre-releases: The stamp step runs unconditionally, but that's fine — pre-release publishes should show the pre-release tag. The stamp is transient (reverted before the registry PR) and only affects the published site for that run. Manual dispatch with an older tag: If someone explicitly passes The race condition this PR fixes: On a tag push, CodeRabbit's suggested fix reintroduces the exact race condition this PR eliminates by falling back to |
Summary
Use the already-resolved tag from the
resolvestep to stamp the "Latest · vX.Y.Z" display name, instead of querying the GitHubreleases/latestAPI which races with Release creation on tag push.Motivation / Context
On a tag push, the Release object may not exist yet, causing the stamp to show the previous version. Observed in run 26770200319: v0.14.0 publish stamped "Latest · v0.13.0".
Fixes: #1134
Type of Change
Component(s) Affected
.github/workflows/publish-fern-docs.ymlImplementation Notes
Replaces the
curl releases/latestAPI call with${{ steps.resolve.outputs.tag }}which is already available from the earlier resolve step. This is the same pattern nvsentinel and topograph use.Testing
No test commands — CI workflow change. Verified by inspecting the existing step logic and comparing with production patterns in nvsentinel/topograph.
Risk Assessment
Rollout notes: Next
Publish Fern Docsrun will use the resolved tag. No migration needed.Checklist
make testwith-race)make lint)git commit -S)