From 2d99e767b70f9890c1e2346aab140fd1c2eda80b Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 14 Sep 2021 09:36:03 +0200 Subject: [PATCH] fix(platform): put typed platform rule first (#11722) --- lib/platform/index.spec.ts | 2 +- lib/platform/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/platform/index.spec.ts b/lib/platform/index.spec.ts index 790180605afb67..ef366e3a2bc436 100644 --- a/lib/platform/index.spec.ts +++ b/lib/platform/index.spec.ts @@ -61,12 +61,12 @@ describe('platform/index', () => { gitAuthor: 'user@domain.com', hostRules: [ { + hostType: 'bitbucket', matchHost: 'api.bitbucket.org', password: '123', username: 'abc', }, { - hostType: 'bitbucket', matchHost: 'api.bitbucket.org', password: '123', username: 'abc', diff --git a/lib/platform/index.ts b/lib/platform/index.ts index c99763c5279f90..f86e7382c2da43 100644 --- a/lib/platform/index.ts +++ b/lib/platform/index.ts @@ -65,13 +65,13 @@ export async function initPlatform(config: AllConfig): Promise { } }); returnConfig.hostRules = returnConfig.hostRules || []; - returnConfig.hostRules.push(platformRule); - hostRules.add(platformRule); const typedPlatformRule = { ...platformRule, hostType: returnConfig.platform, }; returnConfig.hostRules.push(typedPlatformRule); hostRules.add(typedPlatformRule); + returnConfig.hostRules.push(platformRule); + hostRules.add(platformRule); return returnConfig; }