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,
|
||||
isGreaterThan,
|
||||
isPinnedVersion,
|
||||
sortVersions,
|
||||
} = require('../../../versioning/semver');
|
||||
const { getRepoTags, sortVersions } = require('../../../datasource/github');
|
||||
const { getRepoTags } = require('../../../datasource/github');
|
||||
|
||||
async function getPackageUpdates(config) {
|
||||
logger.debug('getPackageUpdates()');
|
||||
|
@ -28,8 +29,8 @@ async function getPackageUpdates(config) {
|
|||
const newReleases = (await getRepoTags('nodejs/node'))
|
||||
.map(release => release.replace(/^v/, ''))
|
||||
.filter(release => getMajor(currentVersion) === getMajor(release))
|
||||
.filter(release => isGreaterThan(release, currentVersion))
|
||||
.sort(sortVersions);
|
||||
.filter(release => isGreaterThan(release, currentVersion));
|
||||
newReleases.sort(sortVersions);
|
||||
// istanbul ignore if
|
||||
if (endpoint) {
|
||||
logger.debug('Restoring GHE token and endpoint');
|
||||
|
@ -41,7 +42,7 @@ async function getPackageUpdates(config) {
|
|||
} else {
|
||||
return [];
|
||||
}
|
||||
const newVersion = newReleases.pop();
|
||||
const newVersion = newReleases[newReleases.length - 1];
|
||||
return [
|
||||
{
|
||||
type: getMajor(newVersion) > getMajor(currentVersion) ? 'major' : 'minor',
|
||||
|
|
Loading…
Reference in a new issue