Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(platform): put typed platform rule first (#11722)
  • Loading branch information
rarkins committed Sep 14, 2021
1 parent 0decf99 commit 2d99e76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/platform/index.spec.ts
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions lib/platform/index.ts
Expand Up @@ -65,13 +65,13 @@ export async function initPlatform(config: AllConfig): Promise<AllConfig> {
}
});
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;
}

0 comments on commit 2d99e76

Please sign in to comment.