mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(node): use semver sort
This commit is contained in:
parent
1da997dbe6
commit
5475e567d7
1 changed files with 5 additions and 4 deletions
|
@ -3,8 +3,9 @@ const {
|
||||||
getMinor,
|
getMinor,
|
||||||
isGreaterThan,
|
isGreaterThan,
|
||||||
isPinnedVersion,
|
isPinnedVersion,
|
||||||
|
sortVersions,
|
||||||
} = require('../../../versioning/semver');
|
} = require('../../../versioning/semver');
|
||||||
const { getRepoTags, sortVersions } = require('../../../datasource/github');
|
const { getRepoTags } = require('../../../datasource/github');
|
||||||
|
|
||||||
async function getPackageUpdates(config) {
|
async function getPackageUpdates(config) {
|
||||||
logger.debug('getPackageUpdates()');
|
logger.debug('getPackageUpdates()');
|
||||||
|
@ -28,8 +29,8 @@ async function getPackageUpdates(config) {
|
||||||
const newReleases = (await getRepoTags('nodejs/node'))
|
const newReleases = (await getRepoTags('nodejs/node'))
|
||||||
.map(release => release.replace(/^v/, ''))
|
.map(release => release.replace(/^v/, ''))
|
||||||
.filter(release => getMajor(currentVersion) === getMajor(release))
|
.filter(release => getMajor(currentVersion) === getMajor(release))
|
||||||
.filter(release => isGreaterThan(release, currentVersion))
|
.filter(release => isGreaterThan(release, currentVersion));
|
||||||
.sort(sortVersions);
|
newReleases.sort(sortVersions);
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (endpoint) {
|
if (endpoint) {
|
||||||
logger.debug('Restoring GHE token and endpoint');
|
logger.debug('Restoring GHE token and endpoint');
|
||||||
|
@ -41,7 +42,7 @@ async function getPackageUpdates(config) {
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const newVersion = newReleases.pop();
|
const newVersion = newReleases[newReleases.length - 1];
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
type: getMajor(newVersion) > getMajor(currentVersion) ? 'major' : 'minor',
|
type: getMajor(newVersion) > getMajor(currentVersion) ? 'major' : 'minor',
|
||||||
|
|
Loading…
Reference in a new issue