Compare commits

..

4 Commits

Author SHA1 Message Date
Bruno Borges 7d5aab9259 Update contributor guide with emoji for clarity 2026-06-19 15:21:20 -04:00
Sean Proctor baa1691374 fix: reject non-semver candidate versions in isVersionSatisfies (#1009)
Distributions like JetBrains Runtime publish 4-segment versions such as
'17.0.8.1+1080.1' that the semver package rejects. Both compareBuild and
satisfies throw on these, which surfaced to users as "Error: Invalid
Version: 17.0.8.1+1080.1" and aborted the whole install when any
available version was non-semver. Guard with an early semver.valid check
so unparseable versions are treated as a non-match.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-17 22:47:02 -05:00
George Adams bc52a13212 fix CodeQL permissions (#1025) 2026-06-17 07:58:23 -07:00
Josh Soref c9b6aee07e Fix codeql workflow permissions (#993)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2026-06-17 07:52:02 -07:00
8 changed files with 406 additions and 555 deletions
+4
View File
@@ -10,5 +10,9 @@ on:
jobs:
call-codeQL-analysis:
permissions:
actions: read
contents: read
security-events: write
name: CodeQL analysis
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
+5 -1
View File
@@ -29,7 +29,11 @@ describe('isVersionSatisfies', () => {
['2.5.1+3', '2.5.1+3', true],
['2.5.1+3', '2.5.1+2', false],
['15.0.0+14', '15.0.0+14.1.202003190635', false],
['15.0.0+14.1.202003190635', '15.0.0+14.1.202003190635', true]
['15.0.0+14.1.202003190635', '15.0.0+14.1.202003190635', true],
// 4-segment versions (e.g. JetBrains Runtime '17.0.8.1+1080.1') are not
// valid semver — they should be rejected, not throw.
['25.0.3+480.61', '17.0.8.1+1080.1', false],
['17', '17.0.8.1+1080.1', false]
])(
'%s, %s -> %s',
(inputRange: string, inputVersion: string, expected: boolean) => {
+7
View File
@@ -52208,6 +52208,13 @@ function getDownloadArchiveExtension() {
exports.getDownloadArchiveExtension = getDownloadArchiveExtension;
function isVersionSatisfies(range, version) {
var _a;
// Some distributions (e.g. JetBrains Runtime) publish 4-segment versions
// like '17.0.8.1+1080.1' that semver rejects. If the candidate version
// isn't valid semver, it can't match — bail out rather than letting
// compareBuild / satisfies throw.
if (!semver.valid(version)) {
return false;
}
if (semver.valid(range)) {
// if full version with build digit is provided as a range (such as '1.2.3+4')
// we should check for exact equal via compareBuild
+7
View File
@@ -81039,6 +81039,13 @@ function getDownloadArchiveExtension() {
exports.getDownloadArchiveExtension = getDownloadArchiveExtension;
function isVersionSatisfies(range, version) {
var _a;
// Some distributions (e.g. JetBrains Runtime) publish 4-segment versions
// like '17.0.8.1+1080.1' that semver rejects. If the candidate version
// isn't valid semver, it can't match — bail out rather than letting
// compareBuild / satisfies throw.
if (!semver.valid(version)) {
return false;
}
if (semver.valid(range)) {
// if full version with build digit is provided as a range (such as '1.2.3+4')
// we should check for exact equal via compareBuild
+5 -5
View File
@@ -6,13 +6,13 @@ We have prepared a short guide so that the process of making your contribution i
## How can I contribute...
* [Contribute Documentation:green_book:](#contribute-documentation)
* [:green_book: Contribute Documentation](#contribute-documentation)
* [Contribute Code :computer:](#contribute-code)
* [:computer: Contribute Code](#contribute-code)
* [Provide Support on Issues:pencil:](#provide-support-on-issues)
* [:pencil: Provide Support on Issues](#provide-support-on-issues)
* [Review Pull Requests:mag:](#review-pull-requests)
* [:mag: Review Pull Requests](#review-pull-requests)
## Contribute documentation
@@ -111,4 +111,4 @@ Another great way to contribute is is to review pull request. Please, be extra k
- Make sure you're familiar with the code or documentation is updated, unless it's a minor change (spellchecking, minor formatting, etc.)
- Review changes using the GitHub functionality. You can ask a clarifying question, point out an error or suggest an alternative.
> Note: You may ask for minor changes - "nitpicks", but consider whether they are real blockers to merging or not
- Submit your review, which may include comments, an approval, or a changes request
- Submit your review, which may include comments, an approval, or a changes request
+369 -548
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -46,7 +46,7 @@
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.61.1",
"@vercel/ncc": "^0.44.0",
"eslint": "^10.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-node": "^11.1.0",
+8
View File
@@ -55,6 +55,14 @@ export function getDownloadArchiveExtension() {
}
export function isVersionSatisfies(range: string, version: string): boolean {
// Some distributions (e.g. JetBrains Runtime) publish 4-segment versions
// like '17.0.8.1+1080.1' that semver rejects. If the candidate version
// isn't valid semver, it can't match — bail out rather than letting
// compareBuild / satisfies throw.
if (!semver.valid(version)) {
return false;
}
if (semver.valid(range)) {
// if full version with build digit is provided as a range (such as '1.2.3+4')
// we should check for exact equal via compareBuild