mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +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',
|
hostType: 'gitea',
|
||||||
matchHost: 'gt.example.com',
|
matchHost: 'gt.example.com',
|
||||||
});
|
});
|
||||||
|
hostRules.add({
|
||||||
|
hostType: 'bitbucket',
|
||||||
|
matchHost: 'bb.example.com',
|
||||||
|
});
|
||||||
expect(detectPlatform('https://gl.example.com/chalk/chalk')).toBe(
|
expect(detectPlatform('https://gl.example.com/chalk/chalk')).toBe(
|
||||||
'gitlab'
|
'gitlab'
|
||||||
);
|
);
|
||||||
expect(detectPlatform('https://gh.example.com/chalk/chalk')).toBe(
|
expect(detectPlatform('https://gh.example.com/chalk/chalk')).toBe(
|
||||||
'github'
|
'github'
|
||||||
);
|
);
|
||||||
|
expect(detectPlatform('https://bb.example.com/chalk/chalk')).toBe(
|
||||||
|
'bitbucket'
|
||||||
|
);
|
||||||
expect(detectPlatform('https://gt.example.com/chalk/chalk')).toBeNull();
|
expect(detectPlatform('https://gt.example.com/chalk/chalk')).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
BITBUCKET_API_USING_HOST_TYPES,
|
||||||
GITHUB_API_USING_HOST_TYPES,
|
GITHUB_API_USING_HOST_TYPES,
|
||||||
GITLAB_API_USING_HOST_TYPES,
|
GITLAB_API_USING_HOST_TYPES,
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
|
@ -34,6 +35,9 @@ export function detectPlatform(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BITBUCKET_API_USING_HOST_TYPES.includes(hostType)) {
|
||||||
|
return 'bitbucket';
|
||||||
|
}
|
||||||
if (GITLAB_API_USING_HOST_TYPES.includes(hostType)) {
|
if (GITLAB_API_USING_HOST_TYPES.includes(hostType)) {
|
||||||
return 'gitlab';
|
return 'gitlab';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue