fix(prepare): handle scoped tag prefixes in auto version resolution#773
Merged
fix(prepare): handle scoped tag prefixes in auto version resolution#773
Conversation
- simple-git: 3.30.0 → 3.33.0 (fixes CVE-2026-28292, CRITICAL CVSS 9.8) RCE via case-insensitive protocol.allow bypass in blockUnsafeOperationsPlugin - tar: 7.5.8 → 7.5.11 (fixes CVE-2026-29786, HIGH CVSS 8.2) Hardlink path traversal via drive-relative linkpath Also dismissed Dependabot alert #119 (@tootallnate/once, LOW severity) as tolerable risk — blocked upstream by teeny-request pinning http-proxy-agent@^5, and the vulnerability requires AbortSignal usage patterns not present in Craft.
Use the existing getVersion() utility to extract semver from git tags instead of manual regex that only handled 'v' prefix and bare versions. Tags like '@scope/package@1.2.3' were falling through to the '0.0.0' fallback, causing auto version to resolve as '0.1.0' instead of the correct next version.
f2c33f0 to
c92cfff
Compare
7 tasks
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.
Problem
resolveVersion()inprepare.tsfails to extract the semver from git tags that use scoped prefixes like@spotlightjs/spotlight@4.10.0. The manual regex only handlesv-prefixed (v1.2.3) and bare (1.2.3) tags:For
@spotlightjs/spotlight@4.10.0,.replace(/^v/, '')is a no-op and.match(/^\d/)returns null, so it falls through to'0.0.0'. This causesautoversion to resolve as0.1.0instead of4.11.0.Fix
Replace the manual regex with the existing
getVersion()utility fromutils/version.ts, which correctly extracts semver from any string using a proper regex:Adds a test case for scoped package tag extraction.