diff --git a/lib/modules/datasource/galaxy-collection/__fixtures__/community_kubernetes_base.json b/lib/modules/datasource/galaxy-collection/__fixtures__/community_kubernetes_base.json index f79b4ce631f6f6..f8874fb383a13b 100644 --- a/lib/modules/datasource/galaxy-collection/__fixtures__/community_kubernetes_base.json +++ b/lib/modules/datasource/galaxy-collection/__fixtures__/community_kubernetes_base.json @@ -5,8 +5,8 @@ "deprecated": false, "versions_url": "/api/v3/plugin/ansible/content/published/collections/index/community/kubernetes/versions/", "highest_version": { - "href": "/api/v3/plugin/ansible/content/published/collections/index/community/kubernetes/versions/2.0.1/", - "version": "2.0.1" + "href": "/api/v3/plugin/ansible/content/published/collections/index/community/kubernetes/versions/1.2.1/", + "version": "1.2.1" }, "created_at": "2023-05-08T20:27:28.514620Z", "updated_at": "2023-10-15T22:54:12.688681Z", diff --git a/lib/modules/datasource/galaxy-collection/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/galaxy-collection/__snapshots__/index.spec.ts.snap index 8000b0abe9917a..65102373242d5b 100644 --- a/lib/modules/datasource/galaxy-collection/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/galaxy-collection/__snapshots__/index.spec.ts.snap @@ -29,5 +29,6 @@ exports[`modules/datasource/galaxy-collection/index getReleases processes real d "version": "1.2.1", }, ], + "sourceUrl": "https://github.com/ansible-collections/community.kubernetes", } `; diff --git a/lib/modules/datasource/galaxy-collection/index.ts b/lib/modules/datasource/galaxy-collection/index.ts index d73de1c2a19ba8..e6e8a63acffb02 100644 --- a/lib/modules/datasource/galaxy-collection/index.ts +++ b/lib/modules/datasource/galaxy-collection/index.ts @@ -86,8 +86,14 @@ export class GalaxyCollectionDatasource extends Datasource { const filteredReleases = enrichedReleases.filter(is.truthy); // extract base information which are only provided on the release from the newest release + // Find the source URL of the highest version release + const sourceUrlOfHighestRelease = enrichedReleases.find( + (release) => baseProject.highest_version.version === release.version, + )?.sourceUrl; + return { releases: filteredReleases, + sourceUrl: sourceUrlOfHighestRelease, }; }