From 67e3630704b1c4db9f251fc4b3700f66194d2349 Mon Sep 17 00:00:00 2001 From: Stephen Collings Date: Thu, 15 Feb 2024 16:31:04 +0000 Subject: [PATCH] fix: diff of branch protection bypass users --- lib/mergeDeep.js | 2 +- test/unit/lib/mergeDeep.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mergeDeep.js b/lib/mergeDeep.js index 8fc3bb56..25ffb1b0 100644 --- a/lib/mergeDeep.js +++ b/lib/mergeDeep.js @@ -1,7 +1,7 @@ const mergeBy = require('./mergeArrayBy') const DeploymentConfig = require('./deploymentConfig') -const NAME_FIELDS = ['name', 'username', 'actor_id', 'type', 'login', 'key_prefix'] +const NAME_FIELDS = ['name', 'username', 'actor_id', 'login', 'type', 'key_prefix'] const NAME_USERNAME_PROPERTY = item => NAME_FIELDS.find(prop => Object.prototype.hasOwnProperty.call(item, prop)) const GET_NAME_USERNAME_PROPERTY = item => { if (NAME_USERNAME_PROPERTY(item)) return item[NAME_USERNAME_PROPERTY(item)] } diff --git a/test/unit/lib/mergeDeep.test.js b/test/unit/lib/mergeDeep.test.js index 2fe015c6..7016bd51 100644 --- a/test/unit/lib/mergeDeep.test.js +++ b/test/unit/lib/mergeDeep.test.js @@ -981,17 +981,17 @@ entries: dismissal_restrictions: { apps: [], teams: [], - users: [{ login: 'test' }, { login: 'test2' }] + users: [{ login: 'test', type: 'User' }, { login: 'test2', type: 'User' }] } } } - + const source = { required_pull_request_reviews: { dismissal_restrictions: { apps: [], teams: [], - users: [{ login: 'test' }, { login: 'test2' }] + users: ['test', 'test2'] } } }