Repository navigation
fix(release): return 'latest' to the newest tag after publishing a draft - #471
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #471 +/- ##
=======================================
Coverage 91.59% 91.59%
=======================================
Files 390 390
Lines 50146 50146
=======================================
+ Hits 45929 45930 +1
+ Misses 4211 4210 -1
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Publishing a draft makes GitHub mark it `latest`, which is wrong whenever a re-run publishes an older tag -- the exact recovery path this job exists for. On 2026-11-14, publishing the v0.1.8/v0.1.9/v0.2.0 drafts left /releases/latest answering v0.2.0 until it was corrected by hand. After flipping the draft public, compare the published tag against the highest published version and hand 'latest' back to it. A v0.4.1-style run is a no-op; an older tag cannot rewrite the headline. Signed-off-by: pi <dimetron@me.com>
dimetron
force-pushed
the
fix/release-latest-guard
branch
from
November 14, 2026 14:12
ff3eb9d to
bf55b4a
Compare
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.
Problem
Publishing a draft release makes GitHub mark it
latest. That is wrong whenever a re-run publishes an older tag — which is the normal recovery path thepublishjob exists for.Measured on 2026-11-14: publishing the
v0.1.8/v0.1.9/v0.2.0drafts left/releases/latestanswering v0.2.0 whilev0.4.1was the newest release. It had to be corrected by hand twice.Fix
After flipping the draft public, read the highest published (non-draft, non-prerelease) tag and hand
latestback to it.A normal run (publishing the newest tag) is a no-op. An older tag cannot rewrite the headline. An empty result leaves the state alone rather than passing an empty argument to
gh release edit.Verification
Logic exercised against the real repository:
Gates:
make lint— 0 issuesgo build ./...— OKbash -non the extracted step — OKgit verify-commit)