diff --git a/lib/modules/manager/ansible-galaxy/__fixtures__/collections1.yml b/lib/modules/manager/ansible-galaxy/__fixtures__/collections1.yml index f6a857277be7be5cb4498b404005b11d564c317b..7f40d32010e1710750a19a4fa33df7648deb4de4 100644 --- a/lib/modules/manager/ansible-galaxy/__fixtures__/collections1.yml +++ b/lib/modules/manager/ansible-galaxy/__fixtures__/collections1.yml @@ -25,6 +25,12 @@ collections: version: 1.2.2 type: git + # explicit git repo + - name: namespace.mycollection + version: 3.0.0 + type: git + source: https://example.com/organization/repo_name.git + # appendix style version definition - name: https://example.com/organization/repo_name.git,1.2.2 diff --git a/lib/modules/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap index feb715ef9c247f73657949b0bce754a328fe57ed..e7d85ef032d30674c1c33affc43d33bd6794f320 100644 --- a/lib/modules/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/ansible-galaxy/__snapshots__/extract.spec.ts.snap @@ -32,6 +32,13 @@ exports[`modules/manager/ansible-galaxy/extract extractPackageFile() check colle "depType": "galaxy-collection", "packageName": "https://example.com/organization/repo_name.git", }, + { + "currentValue": "3.0.0", + "datasource": "git-tags", + "depName": "namespace.mycollection", + "depType": "galaxy-collection", + "packageName": "https://example.com/organization/repo_name.git", + }, { "currentValue": "1.2.2", "datasource": "git-tags", diff --git a/lib/modules/manager/ansible-galaxy/collections.ts b/lib/modules/manager/ansible-galaxy/collections.ts index f84bf3bd3ae24da272112f26a609ea85e177e01f..0846b3da532c1036eb180c908489efe55dff6e07 100644 --- a/lib/modules/manager/ansible-galaxy/collections.ts +++ b/lib/modules/manager/ansible-galaxy/collections.ts @@ -30,7 +30,7 @@ function interpretLine( } case 'source': { localDependency.managerData.source = value; - if (value?.startsWith('git@')) { + if (value?.startsWith('git@') || value?.endsWith('.git')) { localDependency.packageName = value; } else { localDependency.registryUrls = value diff --git a/lib/modules/manager/ansible-galaxy/extract.spec.ts b/lib/modules/manager/ansible-galaxy/extract.spec.ts index dd1e0f95b87c6e918f7b2267cd95b9e7bd166507..13c6f630fb6a2ed776d8d18d479eac5366dc6374 100644 --- a/lib/modules/manager/ansible-galaxy/extract.spec.ts +++ b/lib/modules/manager/ansible-galaxy/extract.spec.ts @@ -31,7 +31,7 @@ describe('modules/manager/ansible-galaxy/extract', () => { it('extracts dependencies from requirements.yml with a space at the end of line', () => { const yamlFile = codeBlock`collections: - name: https://github.com/lowlydba/lowlydba.sqlserver.git - type: git + type: git version: 1.1.3`; const res = extractPackageFile(yamlFile, 'requirements.yml'); expect(res?.deps).toHaveLength(1); @@ -66,7 +66,7 @@ describe('modules/manager/ansible-galaxy/extract', () => { it('check collection style requirements file', () => { const res = extractPackageFile(collections1, 'requirements.yml'); expect(res?.deps).toMatchSnapshot(); - expect(res?.deps).toHaveLength(13); + expect(res?.deps).toHaveLength(14); expect(res?.deps.filter((value) => value.skipReason)).toHaveLength(6); });