Skip to content
Snippets Groups Projects
Unverified Commit 3a460c21 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(bitbucket): Extract getSourceUrl function (#12512)

parent e09618f5
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,12 @@ export class BitBucketTagsDatasource extends Datasource {
)}:${repo}:${type}`;
}
static getSourceUrl(lookupName: string, registryUrl?: string): string {
const url = BitBucketTagsDatasource.getRegistryURL(registryUrl);
const normalizedUrl = ensureTrailingSlash(url);
return `${normalizedUrl}${lookupName}`;
}
// getReleases fetches list of tags for the repository
@cache({
namespace: BitBucketTagsDatasource.cacheNamespace,
......@@ -51,9 +57,7 @@ export class BitBucketTagsDatasource extends Datasource {
).body;
const dependency: ReleaseResult = {
sourceUrl: `${ensureTrailingSlash(
BitBucketTagsDatasource.getRegistryURL(registryUrl)
)}${repo}`,
sourceUrl: BitBucketTagsDatasource.getSourceUrl(repo, registryUrl),
registryUrl: BitBucketTagsDatasource.getRegistryURL(registryUrl),
releases: null,
};
......
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