Skip to content

ci(release): keep an existing tag instead of failing - #17

Merged
SamTV12345 merged 2 commits into
mainfrom
fix/publish-existing-tag
Nov 23, 2026
Merged

SamTV12345 merged 2 commits into
mainfrom
fix/publish-existing-tag

Conversation

@SamTV12345

Copy link
Copy Markdown
Member

The v0.0.14 publish run published to npm and pushed the release commit, but then failed with fatal: tag 'v0.0.14' already exists because the tag had been created beforehand. The step now skips tagging when the tag exists.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RMvvMtnCwj6ycD9fwLYVu
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Keep existing release tags during npm publishing

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Skip tag creation when the release tag already exists locally, preventing a post-publish failure.
• Continue creating and pushing the tag when it does not exist.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed validation and final tag operation jointly control one end-to-end outcome: publishing the requested package version and associating that release with its source tag.
  • The propagation path is direct from the workflow change to this release behavior; no separate functional capability is established by the tag or package metadata steps.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before: the workflow unconditionally attempted to create and push the requested tag after publication.
  • After: it must handle the compatibility cases of no existing tag, an existing tag at the checked-out HEAD, and an existing tag at a different commit; the final step then repeats the existence decision after publication.
  • New correctness conditions are that an existing tag must identify the exact source being released and that a matching tag must not be recreated, while a missing tag must still be created and pushed.
  • These are changed state/branch conditions in a release transition, but the logic remains a direct commit-identity comparison and conditional tag operation rather than a new algorithm or concurrency protocol.
Potential damage 🟡 Medium 🩹 Temporary loss

  • Conditionally, if the changed validation or reuse logic rejects a release that should proceed, the requested publication is unavailable until the tag state is corrected and the workflow is rerun.
  • The source shows an explicit abort before publication for a tag whose commit differs from HEAD.
  • Recovery is operationally reversible by deleting or correcting the conflicting tag and rerunning; code rollback alone would not repair an already conflicting remote tag.
  • If the logic instead preserves the intended matching tag, the normal release behavior remains available.
  • No supported evidence shows corruption of package contents or irreversible external effects from this change.
  • Recoverable after correcting the remote tag state or workflow input and rerunning the manual release.
  • A previously published package or remote tag would require the normal repository/npm operational procedures if any partial release had already occurred; automatic repair is not established.
Assessed commit 0dce20d
Diagram

graph TD
  A["Publish package"] --> B["Commit metadata"] --> C{"Local tag exists?"}
  C -->|Yes| D["Keep existing tag"]
  C -->|No| E["Create and push tag"]
Loading
High-Level Assessment

Keep the local-tag check: checkout fetches full history, and the check directly prevents the reported duplicate-tag failure. A separate remote lookup adds complexity without addressing the observed case.

Files changed (1) +7 / -2

Bug fix (1) +7 / -2
publish.ymlPreserve an existing release tag +7/-2

Preserve an existing release tag

• Checks whether the version tag exists locally before tagging. If it does, the workflow logs that it is keeping the tag; otherwise, it creates and pushes the tag as before.

.github/workflows/publish.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Release tags can point to older source ✓ Resolved
Description
The existing-tag branch skips tagging without checking whether refs/tags/v${{ inputs.version }}
resolves to the release commit just pushed to main. When a tag was created before the workflow
commits the updated package metadata, the run succeeds while that version's tag still identifies the
earlier source.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@SamTV12345
SamTV12345 merged commit d262bb8 into main Nov 23, 2026
3 checks passed
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