-
Notifications
You must be signed in to change notification settings - Fork 43
fix: create GitHub release against the v-prefixed tag #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 ⚪ Nit (same code lives in publish-svn-v2.yml:174):
prerelease: /alpha|beta/i.test(version)only flagsalphaandbetasubstrings, so a manually-pushed tag likev3.9.1-rc.1(or-pre/-dev/-next/-snapshot) would match thev3.*trigger and be published as a stable GitHub Release. Todaytag-on-release-merge.ymlonly auto-tags strictX.Y.Z, so this only bites a manually-pushed prerelease tag — but broadening to/-(alpha|beta|rc|pre|dev|snapshot)/iis a one-liner while this code is being touched.Extended reasoning...
What the bug is
In both
publish-svn.yml:145andpublish-svn-v2.yml:174, the GitHub Release is created with:That regex only recognises
alphaandbetaas prerelease markers. The other conventional identifiers —rc(release candidate, by far the most common after alpha/beta),pre,dev,next,snapshot— are not matched.Concrete trigger
Step by step for a hypothetical
v3.9.1-rc.1:v3.9.1-rc.1. It matches the workflow triggertags: 'v3.*'and runspublish-svn.yml.bare_version = '3.9.1-rc.1'.github-releasejob runs the inlinegithub-script./alpha|beta/i.test('3.9.1-rc.1')evaluates tofalse.createReleaseis called withprerelease: false— published as a stable GitHub Release.Why existing guards don't catch it
tag-on-release-merge.yml:34enforces^chore: Release ([0-9]+\.[0-9]+\.[0-9]+)( \(#[0-9]+\))?$on the commit subject before creating the v-tag, so the auto-tag flow only produces strictX.Y.Z. The only path to a prerelease v-tag is a maintainer manually pushing one — which is also the same path the PR description acknowledges was used for the 3.9.1 recovery.Addressing the refutation
One verifier refuted this as a duplicate of a previously-refuted bug and as implausible because (a) the repo's auto-tag flow can't produce prerelease tags and (b) WP.org SVN doesn't have a prerelease concept. Both points are correct in fact but don't dispose of the issue: the
prerelease:field clearly exists in the code with the intent of flagging prereleases — it just undercovers the conventional identifier set. The 'SVN trunk publishes a -rc tag as stable anyway' point is a separate, larger problem; it doesn't argue against fixing this line. And the manual-prerelease scenario, while rare, is exactly the kind of edge case that this PR exists to make self-healing.Impact
Low — only fires when a maintainer manually pushes a non-
X.Y.Zv-tag. The wrong-flag GitHub Release is also recoverable (edit the release, flip the checkbox). Hence nit, not normal.Fix
Broaden the test to cover the standard set:
or, if the intent is 'any SemVer prerelease', just
/-/.test(version)since bareX.Y.Znever contains a hyphen. Apply in both files (publish-svn.yml:145and `publish-svn-v2.yml:174").