Skip to content

ci: guard releases against duplicate versions and dead tags - #46

Merged
trick77 merged 1 commit into
masterfrom
ci/release-guards
Jul 27, 2026
Merged

ci: guard releases against duplicate versions and dead tags#46
trick77 merged 1 commit into
masterfrom
ci/release-guards

Conversation

@trick77

@trick77 trick77 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Ported from opencode-litellm-pricing, where both guards earned their place while debugging a trusted-publisher misconfiguration that failed four consecutive releases.

  • Reject an already-published version before packing and signing rather than after. npm refuses duplicates, so the failure is otherwise late and noisy.
  • Delete the tag when nothing was published. Such a tag can't be re-pushed and blocks the retry; over there it saved manual tag surgery three times. Guarded on steps.publish.outcome != 'success', so a tag whose package did go out is left alone — npm won't take the same version twice, and that release has to be finished by hand.
  • ci.yaml aligned on npm ci --ignore-scripts, matching release.yaml.

Nothing about the existing publish path changes; this repo's releases already work.

Verification

The duplicate guard was extracted from the parsed YAML and run against the live registry: with package.json at the published 0.9.0 it errors and exits 1. Workflow parses clean, step order otherwise unchanged.

Ported from opencode-litellm-pricing, where both earned their place while
debugging a trusted-publisher misconfiguration that failed four releases.

Reject a version already on npm before packing and signing, rather than after —
npm refuses duplicates and the failure is otherwise late and noisy.

Delete the tag when nothing was published. Such a tag cannot be re-pushed and
blocks the retry. Guarded on the publish step's own outcome, so a tag whose
package did go out is left alone: npm will not take the same version twice, and
that release has to be finished by hand.

Also align ci.yaml on npm ci --ignore-scripts, matching release.yaml.
@trick77
trick77 merged commit 71b6574 into master Jul 27, 2026
3 checks passed
@trick77
trick77 deleted the ci/release-guards branch July 27, 2026 11:57
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