diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ec90245..33358d8 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,9 +1,9 @@ -name: 'Continuous Integration' +name: "Continuous Integration" on: push: branches: - - main + - main pull_request: jobs: @@ -11,9 +11,9 @@ jobs: name: Check dist/ directory uses: actions/reusable-workflows/.github/workflows/check-dist.yml@2826fb8353263a138210fc017301ce5767a9c0d4 with: - node-version: "20.x" + node-version: "20.19.1" test: name: Test uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@2826fb8353263a138210fc017301ce5767a9c0d4 with: - node-version: "20.x" + node-version: "20.19.1" diff --git a/dist/index.js b/dist/index.js index 9297c5c..a259e53 100644 --- a/dist/index.js +++ b/dist/index.js @@ -50,8 +50,8 @@ async function fetchReleases (githubToken) { if (resp.message.statusCode !== hc.HttpCodes.OK) { throw new Error('failed fetching releases (' + resp.message.statusCode + ')'); } - - let body = await resp.readBody(); + + const body = await resp.readBody(); const releasesMeta = JSON.parse(body); /** @@ -6437,6 +6437,7 @@ const isSatisfiable = (comparators, options) => { // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], '') debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) @@ -6857,11 +6858,25 @@ class SemVer { other = new SemVer(other, this.options) } - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) + if (this.major < other.major) { + return -1 + } + if (this.major > other.major) { + return 1 + } + if (this.minor < other.minor) { + return -1 + } + if (this.minor > other.minor) { + return 1 + } + if (this.patch < other.patch) { + return -1 + } + if (this.patch > other.patch) { + return 1 + } + return 0 } comparePre (other) { @@ -7762,6 +7777,10 @@ module.exports = debug const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { + if (typeof a === 'number' && typeof b === 'number') { + return a === b ? 0 : a < b ? -1 : 1 + } + const anum = numeric.test(a) const bnum = numeric.test(b) @@ -9179,4 +9198,4 @@ const setup = __nccwpck_require__(3882); module.exports = __webpack_exports__; /******/ })() -; +; \ No newline at end of file diff --git a/dist/index1.js b/dist/index1.js index 6367bfb..4d0c22f 100755 --- a/dist/index1.js +++ b/dist/index1.js @@ -3711,4 +3711,4 @@ async function checkTofu () { module.exports = __webpack_exports__; /******/ })() -; +; \ No newline at end of file diff --git a/lib/releases.js b/lib/releases.js index 5016228..77e0207 100644 --- a/lib/releases.js +++ b/lib/releases.js @@ -44,8 +44,8 @@ async function fetchReleases (githubToken) { if (resp.message.statusCode !== hc.HttpCodes.OK) { throw new Error('failed fetching releases (' + resp.message.statusCode + ')'); } - - let body = await resp.readBody(); + + const body = await resp.readBody(); const releasesMeta = JSON.parse(body); /** diff --git a/package-lock.json b/package-lock.json index 83f0f22..cd3bb72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@actions/exec": "1.1.1", "@actions/io": "1.1.3", "@actions/tool-cache": "2.0.2", - "semver": "7.7.2" + "semver": "7.7.3" }, "devDependencies": { "@vercel/ncc": "0.38.4", @@ -6223,9 +6223,9 @@ } }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/package.json b/package.json index f592eab..4c9bc2e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@actions/exec": "1.1.1", "@actions/io": "1.1.3", "@actions/tool-cache": "2.0.2", - "semver": "7.7.2" + "semver": "7.7.3" }, "devDependencies": { "@vercel/ncc": "0.38.4",