fix(ci): support retrying an existing release tag - #9
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the release GitHub Actions workflow to support safely retrying a release for an already-existing tag via workflow_dispatch, while ensuring the package version gate applies consistently.
Changes:
- Adds a required
workflow_dispatchinput (tag) and a derivedRELEASE_TAGenv var. - Applies the package.json version-to-tag check to both tag-push releases and manual retries.
- Makes
gh release createtarget an explicit repository via--repo "$GITHUB_REPOSITORY".
Suppressed comments (3)
.github/workflows/release.yml:15
RELEASE_TAGis derived frominputs.tag, but for non-workflow_dispatch events theinputscontext may be empty/undefined, and for manual runs users sometimes pasterefs/tags/<tag>. Consider basing this ongithub.event.inputs.tagand stripping an optionalrefs/tags/prefix so downstream comparisons andgh release createalways get the plain tag name.
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
.github/workflows/release.yml:15
- For a manual retry, this workflow can be dispatched on the default branch while
RELEASE_TAGpoints at an older tag. That can rebuild artifacts from a different commit (package.json version could still match), which undermines the goal of safely retrying an existing tag. To make retries deterministic, the checkout steps in all jobs should checkoutref: ${{ env.RELEASE_TAG }}wheninputs.tagis provided (or always, since it matchesgithub.ref_nameon tag pushes).
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
.github/workflows/release.yml:93
- The
github-releasejob condition usesinputs.tag != '', buttagis required for workflow_dispatch andinputsmay be unset on push events. Using the event name makes the intent explicit and avoids edge cases around null/empty comparisons.
if: startsWith(github.ref, 'refs/tags/v') || inputs.tag != ''
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+12
| tag: | ||
| description: Existing release tag to retry | ||
| required: true | ||
| type: string |
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.
Use the explicit GitHub repository when creating a release, and add a required tag input for safely retrying an existing release from Actions. The version gate now applies to both tag pushes and manual retries.
Verified the YAML parser and the v0.3.1 version gate locally.