Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}