Skip to content

Commit 5bab98b

Browse files
committed
fix(utils): ignore licence field if it is an object
1 parent 95c8d34 commit 5bab98b

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

test/jobs/__snapshots__/create-version-branch.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ This monorepo update includes releases of one or more dependencies which all bel
102102
---
103103
104104
**Publisher:** finn
105-
**License:** MIT
105+
106106
107107
[Find out more about this release](https://github.com/orgname/flowers).
108108

test/jobs/create-version-branch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ describe('create version branch for dependencies from monorepos', () => {
23512351
repository: {
23522352
url: 'https://github.com/colors/monorepo'
23532353
},
2354-
'license': 'MIT',
2354+
'license': { 'preferred': 'MIT' },
23552355
'_npmUser': {
23562356
name: 'finn',
23572357
email: 'finn.pauls@gmail.com'

utils/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,11 @@ const getLicenseAndPublisherFromVersions = function ({ versions, version, oldVer
328328
const oldVersion = versions[oldVersionResolved]
329329
const publisher = _.get(newVersion, '_npmUser.name')
330330
let license, previousLicense, licenseHasChanged
331-
if (_.has(newVersion, 'license')) {
331+
if (_.has(newVersion, 'license') && typeof newVersion['license'] !== 'object') {
332332
license = newVersion['license'] || 'No license'
333333

334334
// only compare if we have a license field for both versions in the DB
335-
if (_.has(oldVersion, 'license')) {
335+
if (_.has(oldVersion, 'license') && typeof oldVersion['license'] !== 'object') {
336336
previousLicense = oldVersion['license'] || 'No license'
337337
licenseHasChanged = previousLicense !== license
338338
}

0 commit comments

Comments
 (0)