fix(release): skip GitHub Packages publish when version already exists - #47
Merged
Conversation
The release workflow fails with 409 Conflict when re-pushing a tag because GitHub Packages does not allow overwriting existing versions. Add versionExistsOnRegistry() check before publishing — if the version already exists, skip with a [SKIP] message instead of failing. Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
OLDyade
approved these changes
Jul 29, 2026
OLDyade
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. This makes release reruns idempotent without hiding real registry or authentication failures, and the change stays cleanly scoped to the GitHub Packages path. All checks are green.
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.
Which issue(s) this PR fixes:
Fixes the release workflow failure at https://github.com/iflytek/memflywheel/actions/runs/30351326253/job/90249842896
Summary
The release workflow fails with
409 Conflictwhen re-pushing an existing tag because GitHub Packages does not allow overwriting published versions.This PR adds a pre-publish check in
scripts/publish-npm.mjs:versionExistsOnRegistry()usesnpm viewto check if the version already exists on GitHub Packages[SKIP]message instead of failingChecks
pnpm run ciiflytek/memflywheelSpecial notes for reviewers
Only
scripts/publish-npm.mjsis changed — no impact on core packages, adapters, plugins, or e2e tests.