Repository navigation
fix: correct release-type mapping and bump from the registry - #279
Merged
Merged
Conversation
getBuildType inverted the conventional-commit convention: feat cut a major and everything else a patch, leaving minor reachable only by a subject that matched no prefix at all. The match was also an unanchored substring over the whole subject, so "fix: add feature flag" and "chore: document new features" both cut majors because they contain "feat", and a plain merge commit cut a minor. Anchor the prefixes, map feat to minor, honour the "!" and "BREAKING CHANGE" markers for major, and default to patch so a subject that does not declare its intent cannot widen the version. Separately, npm version computed the next version from the checked-in package.json. The "Release [skip-ci]" commit-back is best effort and has drifted: main carries 1.7.3 while the registry serves 1.7.4, so the next patch release would recompute 1.7.4 and fail as a duplicate. Seed the version from the registry before bumping, which makes the commit-back drifting harmless rather than load-bearing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mcarey1590
marked this pull request as ready for review
September 21, 2026 18:43
tnschneider
approved these changes
Sep 21, 2026
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
.github/scripts/pub.sh, two independent bugs in the release path.1. The release-type mapping was inverted
featcut a major.minorwas unreachable from any conventional prefix — it was only the fallback for a subject matching nothing. The match was also an unanchored substring over the entire subject, so anything containing the lettersfeatcut a major:feat: add an optionfix: add feature flagchore: document new featuresfix: sync published version (#244)feat!: drop node 20fix(api)!: rename exportMerge pull request #278 from ...Now: anchored prefixes,
featto minor,!orBREAKING CHANGEto major, everything else to patch. An unrecognised subject no longer silently widens the version.2. The bump was computed from a file that drifts
npm versionread the checked-inpackage.json. TheRelease [skip-ci]commit-back is best effort and has fallen behind — the last one landed in 2022:latestmainlibs/web-socket-client/package.jsonSo the next patch release would compute 1.7.3 to 1.7.4 and fail as a duplicate publish. #244 papered over this by hand-syncing the version; it drifted again on the very next release.
The script now seeds from
npm view <pkg> versionbefore bumping, so the commit-back drifting is harmless instead of load-bearing. If the package is unpublished, it falls back to the checked-in version.How to test
The mapping is a pure function, so it can be exercised directly:
I ran the full table above against both the old and new implementations; every row matches the After column, and the three regression rows reproduce under the old one.
bash -nis clean.For an end-to-end rehearsal without publishing:
Notes for reviewers
fix:, so under the corrected mapping it releases itself as a patch: 1.7.4 to 1.7.5. The workflow checks out the merge commit, so the new script governs its own release.package.jsoncorrect, which is the opposite of what the automation wants. Replaced with the actual CI behaviour and the subject-to-release table.🤖 Generated with Claude Code