From 6d7c6155628276a3a342df2ecd9bf34c69a671ac Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Tue, 17 Dec 2024 10:31:41 -0300 Subject: [PATCH] fix(go): Request only info for versions with the same major --- lib/modules/datasource/go/releases-goproxy.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/modules/datasource/go/releases-goproxy.ts b/lib/modules/datasource/go/releases-goproxy.ts index 951a857afab056..d778a5b9276582 100644 --- a/lib/modules/datasource/go/releases-goproxy.ts +++ b/lib/modules/datasource/go/releases-goproxy.ts @@ -217,7 +217,12 @@ export class GoProxyDatasource extends Datasource { try { const res = await this.listVersions(baseUrl, pkg); - releases = await p.map(res, async (versionInfo) => { + const filteredReleases = res.filter( + ({ version }) => + version.split(regEx(/[^\d]+/)).find(is.truthy) === major.toString(), + ); + + releases = await p.map(filteredReleases, async (versionInfo) => { const { version, newDigest, releaseTimestamp } = versionInfo; if (releaseTimestamp) {