diff --git a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.test.ts b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.test.ts index fe6bb51521..41698e1d04 100644 --- a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.test.ts @@ -33,14 +33,14 @@ describe('GithubDiscoveryProcessor', () => { ).toEqual({ org: 'foo', repoSearchPath: /^proj$/, - catalogPath: 'blob/master/catalog.yaml', + catalogPath: '/blob/master/catalog.yaml', }); expect( parseUrl('https://github.com/foo/proj*/blob/master/catalog.yaml'), ).toEqual({ org: 'foo', repoSearchPath: /^proj.*$/, - catalogPath: 'blob/master/catalog.yaml', + catalogPath: '/blob/master/catalog.yaml', }); }); diff --git a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts index f96943eebb..9af247fd25 100644 --- a/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/GithubDiscoveryProcessor.ts @@ -92,7 +92,7 @@ export class GithubDiscoveryProcessor implements CatalogProcessor { results.location( { type: 'url', - target: `${repository.url}/${catalogPath}`, + target: `${repository.url}${catalogPath}`, }, false, ), @@ -118,7 +118,7 @@ export function parseUrl( return { org: decodeURIComponent(path[0]), repoSearchPath: escapeRegExp(decodeURIComponent(path[1])), - catalogPath: decodeURIComponent(path.slice(2).join('/')), + catalogPath: `/${decodeURIComponent(path.slice(2).join('/'))}`, }; }