mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
feat: detect bitbucket host types (#23075)
This commit is contained in:
parent
7089d1ef2a
commit
db91079d6e
2 changed files with 11 additions and 0 deletions
|
@ -34,12 +34,19 @@ describe('util/common', () => {
|
|||
hostType: 'gitea',
|
||||
matchHost: 'gt.example.com',
|
||||
});
|
||||
hostRules.add({
|
||||
hostType: 'bitbucket',
|
||||
matchHost: 'bb.example.com',
|
||||
});
|
||||
expect(detectPlatform('https://gl.example.com/chalk/chalk')).toBe(
|
||||
'gitlab'
|
||||
);
|
||||
expect(detectPlatform('https://gh.example.com/chalk/chalk')).toBe(
|
||||
'github'
|
||||
);
|
||||
expect(detectPlatform('https://bb.example.com/chalk/chalk')).toBe(
|
||||
'bitbucket'
|
||||
);
|
||||
expect(detectPlatform('https://gt.example.com/chalk/chalk')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
BITBUCKET_API_USING_HOST_TYPES,
|
||||
GITHUB_API_USING_HOST_TYPES,
|
||||
GITLAB_API_USING_HOST_TYPES,
|
||||
} from '../constants';
|
||||
|
@ -34,6 +35,9 @@ export function detectPlatform(
|
|||
return null;
|
||||
}
|
||||
|
||||
if (BITBUCKET_API_USING_HOST_TYPES.includes(hostType)) {
|
||||
return 'bitbucket';
|
||||
}
|
||||
if (GITLAB_API_USING_HOST_TYPES.includes(hostType)) {
|
||||
return 'gitlab';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue