always strip build metadata from nuget versions (#4582)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
committed by
repo-ranger[bot]
parent
1edd15457a
commit
a8fbc5a179
@@ -97,6 +97,15 @@ const schema = Joi.object({
|
||||
.default([]),
|
||||
}).required()
|
||||
|
||||
/*
|
||||
* Strip Build MetaData
|
||||
* Nuget versions may include an optional "build metadata" clause,
|
||||
* seperated from the version by a + character.
|
||||
*/
|
||||
function stripBuildMetadata(version) {
|
||||
return version.split('+')[0]
|
||||
}
|
||||
|
||||
/*
|
||||
* Get information about a single package.
|
||||
*/
|
||||
@@ -184,7 +193,10 @@ function createServiceFamily({
|
||||
withFeed,
|
||||
feed,
|
||||
})
|
||||
const { versions } = await fetch(this, { baseUrl, packageName })
|
||||
let { versions } = await fetch(this, { baseUrl, packageName })
|
||||
versions = versions.map(item => ({
|
||||
version: stripBuildMetadata(item.version),
|
||||
}))
|
||||
let latest = versions.slice(-1).pop()
|
||||
const includePrereleases = which === 'vpre'
|
||||
if (!includePrereleases) {
|
||||
|
||||
@@ -130,8 +130,8 @@ t.create('version (build metadata with -)')
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'nuget',
|
||||
message: 'v1.17.0+1b81349-429',
|
||||
color: 'yellow',
|
||||
message: 'v1.17.0',
|
||||
color: 'blue',
|
||||
})
|
||||
|
||||
t.create('version (not found)')
|
||||
|
||||
Reference in New Issue
Block a user