fix: guard release tarball rename against same-file mv#22
Merged
Conversation
When package.json's version equals the release tag (e.g. both 1.0.0), pnpm pack already produces expost-1.0.0.tgz and the rename-to-tag mv targets the same filename, which errors and fails the release. Guard the mv so it only runs when the names actually differ. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Guard the
mvin the release workflow's pack step so it doesn't try to move the tarball onto itself.Why it failed
Third time's the charm. The last run got all the way through semver-bootstrap, install, build, and pack — then died on:
pnpm packnames the tarball frompackage.json's version (1.0.0), and the release tag resolved tov1.0.0, so the rename-to-tagmvhad identical source and dest → error → no release.Fix
Only rename when the packed name and the tag-derived name actually differ (they diverge once tags advance past the static
package.jsonversion):Verified both branches locally (same-name → skip;
1.0.0pack +v1.1.0tag → renames toexpost-1.1.0.tgz).Result
Merging cuts
v1.0.0withexpost-1.0.0.tgzattached (every prior step already passed on the last run), unblocking beeminder/blog#762.🤖 Generated with Claude Code