mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
fix(ansible-galaxy): handle git source (#21640)
This commit is contained in:
parent
6990f7fc09
commit
bf0e39da5f
2 changed files with 20 additions and 1 deletions
|
@ -30,7 +30,11 @@ function interpretLine(
|
||||||
}
|
}
|
||||||
case 'source': {
|
case 'source': {
|
||||||
localDependency.managerData.source = value;
|
localDependency.managerData.source = value;
|
||||||
localDependency.registryUrls = value ? [value] : [];
|
if (value?.startsWith('git@')) {
|
||||||
|
localDependency.packageName = value;
|
||||||
|
} else {
|
||||||
|
localDependency.registryUrls = value ? [value] : [];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'type': {
|
case 'type': {
|
||||||
|
|
|
@ -38,6 +38,21 @@ describe('modules/manager/ansible-galaxy/extract', () => {
|
||||||
expect(res?.deps[0].currentValue).toBe('1.1.3');
|
expect(res?.deps[0].currentValue).toBe('1.1.3');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('extracts git@ dependencies', () => {
|
||||||
|
const yamlFile = codeBlock`collections:
|
||||||
|
- name: community.docker
|
||||||
|
source: git@github.com:ansible-collections/community.docker
|
||||||
|
type: git
|
||||||
|
version: 2.7.5`;
|
||||||
|
const res = extractPackageFile(yamlFile, 'requirements.yml');
|
||||||
|
expect(res?.deps).toHaveLength(1);
|
||||||
|
expect(res?.deps[0].currentValue).toBe('2.7.5');
|
||||||
|
expect(res?.deps[0].registryUrls).toBeUndefined();
|
||||||
|
expect(res?.deps[0].packageName).toBe(
|
||||||
|
'git@github.com:ansible-collections/community.docker'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('check if an empty file returns null', () => {
|
it('check if an empty file returns null', () => {
|
||||||
const res = extractPackageFile('\n', 'requirements.yml');
|
const res = extractPackageFile('\n', 'requirements.yml');
|
||||||
expect(res).toBeNull();
|
expect(res).toBeNull();
|
||||||
|
|
Loading…
Reference in a new issue