fix(release): recover atomically from push races - #37
Open
kayodebristol wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the reusable npm package release workflow against concurrent updates to the protected branch by pushing the version commit and package tag atomically with bounded retries, and adds a recovery path to publish an already-created immutable package tag.
Changes:
- Add
recovery_taginput to validate an existing package tag’s embeddedpackage.jsonversion and run a release/publish flow without creating a new version. - Make the release push atomic (
git push --atomic) and retry up to 3 times with fetch/rebase + re-validation to recover from protected-branch push races. - Ensure explicit
target_versioncan still trigger a release even when there are no package-directory commits.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+98
to
+103
| echo "current_version=$RECOVERY_VERSION" | ||
| echo "new_version=$RECOVERY_VERSION" | ||
| echo "tag=$RECOVERY_TAG" | ||
| echo "previous_tag=$RECOVERY_TAG" | ||
| echo "recovery=true" | ||
| } >> "$GITHUB_OUTPUT" |
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 changed
mainpush cannot leave an orphan tag.recovery_taginput that validates an existing immutable package tag, creates its GitHub Release, and publishes it without a second version bump.Root cause
The Design Dojo release created and pushed
design-dojo-v0.21.1, but a concurrent merge advancedmainbefore the version commit could be pushed. The separate ref pushes left a valid tag without a mainline version commit, GitHub Release, or npm publication.Recovery
Once the corresponding caller forwards
recovery_tag, dispatch it withdesign-dojo-v0.21.1to publish the already validated artifact from that immutable tag.Validation
actionlint .github/workflows/npm-package-release-reusable.ymldesign-dojo-v0.21.1contains package version0.21.1