Skip to content
Snippets Groups Projects
Unverified Commit 2d99e767 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(platform): put typed platform rule first (#11722)

parent 0decf99b
No related branches found
No related tags found
No related merge requests found
...@@ -61,12 +61,12 @@ describe('platform/index', () => { ...@@ -61,12 +61,12 @@ describe('platform/index', () => {
gitAuthor: 'user@domain.com', gitAuthor: 'user@domain.com',
hostRules: [ hostRules: [
{ {
hostType: 'bitbucket',
matchHost: 'api.bitbucket.org', matchHost: 'api.bitbucket.org',
password: '123', password: '123',
username: 'abc', username: 'abc',
}, },
{ {
hostType: 'bitbucket',
matchHost: 'api.bitbucket.org', matchHost: 'api.bitbucket.org',
password: '123', password: '123',
username: 'abc', username: 'abc',
......
...@@ -65,13 +65,13 @@ export async function initPlatform(config: AllConfig): Promise<AllConfig> { ...@@ -65,13 +65,13 @@ export async function initPlatform(config: AllConfig): Promise<AllConfig> {
} }
}); });
returnConfig.hostRules = returnConfig.hostRules || []; returnConfig.hostRules = returnConfig.hostRules || [];
returnConfig.hostRules.push(platformRule);
hostRules.add(platformRule);
const typedPlatformRule = { const typedPlatformRule = {
...platformRule, ...platformRule,
hostType: returnConfig.platform, hostType: returnConfig.platform,
}; };
returnConfig.hostRules.push(typedPlatformRule); returnConfig.hostRules.push(typedPlatformRule);
hostRules.add(typedPlatformRule); hostRules.add(typedPlatformRule);
returnConfig.hostRules.push(platformRule);
hostRules.add(platformRule);
return returnConfig; return returnConfig;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment