fix(release): push only new tags instead of all tags#31
Merged
ErnestM1234 merged 1 commit intogeneraltranslation:mainfrom Mar 20, 2026
Merged
Conversation
Previously `git push origin --tags` pushed all local tags, which fails when some tags already exist on the remote. Now each tag is pushed individually right after creation, making the step idempotent.
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.
Previously
git push origin --tagspushed all local tags, which fails when some tags already exist on the remote (the 4 rejected tags in the last release run). Now each tag is pushed individually right after creation, making the step idempotent — safe to re-run on failure.Greptile Summary
This PR fixes a release workflow failure where
git push origin --tagswould reject tags that already existed on the remote (from a previous partial run), by instead pushing each tag individually immediately after it is created.Key changes:
git push origin "$tag"is now called inside the loop, right aftergit tag "$tag", replacing the trailinggit push origin --tagsfetch-tags: trueon checkout, so they are found locally and skipped by theif ! git tag -l "$tag"guard)NEW_PACKAGEStracking and downstream release/build/publish steps are unaffectedAssessment: The fix is correct and minimal. The existing
fetch-tags: trueon the checkout step is the key enabler — it ensures any tag already on the remote is present locally before the guard check runs, making the idempotency guarantee reliable. The workflow-levelconcurrencysetting also prevents race conditions between simultaneous pushes tomain.Confidence Score: 5/5
fetch-tags: trueguarantees remote tags are reflected locally before the guard check, so only genuinely new tags are created and pushed. No downstream steps are affected, and the fix is idempotent by design.Important Files Changed
git push origin "$tag"inside the per-tag loop (immediately after tag creation) and removes the trailinggit push origin --tags, fixing the "already exists" rejection when re-running a partially-completed release.Sequence Diagram
sequenceDiagram participant GHA as GitHub Actions Runner participant LocalGit as Local Git (checkout) participant Remote as origin (GitHub) participant PyPI as PyPI GHA->>LocalGit: checkout (fetch-depth=2, fetch-tags=true) Note over LocalGit: All existing remote tags<br/>are now available locally loop For each package in packages/*/ GHA->>LocalGit: git tag -l "$tag" alt Tag does NOT exist locally (= not on remote) GHA->>LocalGit: git tag "$tag" GHA->>Remote: git push origin "$tag" Note over GHA: NEW_PACKAGES += $name else Tag already exists locally (already on remote) Note over GHA: Skip — idempotent on re-run end end loop For each new tag in NEW_PACKAGES GHA->>Remote: gh release create "$tag" end GHA->>GHA: uv build (new packages only) GHA->>PyPI: uv publish dist/*Last reviewed commit: "fix(release): push o..."