Skip to content
Snippets Groups Projects
Unverified Commit 8706b771 authored by Manuel Blechschmidt's avatar Manuel Blechschmidt Committed by GitHub
Browse files

fix(datasource/go): Remove .git/v2 in go package name to retrieve it correctly (#27569)

parent ea0f0440
No related branches found
No related tags found
No related merge requests found
......@@ -260,7 +260,7 @@ describe('modules/datasource/go/base', () => {
hostRules.hostType.mockReturnValue('gitlab');
httpMock
.scope('https://my.custom.domain')
.get('/golang/subgroup/myrepo.git/v2?go-get=1')
.get('/golang/subgroup/myrepo?go-get=1')
.reply(200, Fixtures.get('go-get-gitlab-ee-private-subgroup.html'));
const res = await BaseGoDatasource.getDatasource(
......
......@@ -77,7 +77,8 @@ export class BaseGoDatasource {
private static async goGetDatasource(
goModule: string,
): Promise<DataSource | null> {
const pkgUrl = `https://${goModule}?go-get=1`;
const goModuleUrl = goModule.replace(/\.git\/v2$/, '');
const pkgUrl = `https://${goModuleUrl}?go-get=1`;
// GitHub Enterprise only returns a go-import meta
const res = (await BaseGoDatasource.http.get(pkgUrl)).body;
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment