mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
fix(manager/buildkite): Strip '.git' from git-based plugin names (#14292)
* strip .git from applicable git-based buildkite plugin names * Update lib/manager/buildkite/extract.ts Co-authored-by: Michael Kriese <michael.kriese@visualon.de> * add toEqual matcher in jest test * Update lib/manager/buildkite/extract.spec.ts Co-authored-by: Michael Kriese <michael.kriese@visualon.de> * Update lib/manager/buildkite/extract.spec.ts Co-authored-by: Michael Kriese <michael.kriese@visualon.de> * remove obsolete snapshot Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
9a103cbb51
commit
dd08fd9f32
3 changed files with 18 additions and 1 deletions
4
lib/manager/buildkite/__fixtures__/pipeline6.yml
Normal file
4
lib/manager/buildkite/__fixtures__/pipeline6.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7:
|
||||
username: abc
|
|
@ -1,4 +1,5 @@
|
|||
import { Fixtures } from '../../../test/fixtures';
|
||||
import type { PackageDependency } from '../../manager/types';
|
||||
import { extractPackageFile } from './extract';
|
||||
|
||||
describe('manager/buildkite/extract', () => {
|
||||
|
@ -31,5 +32,16 @@ describe('manager/buildkite/extract', () => {
|
|||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(2);
|
||||
});
|
||||
it('extracts git-based plugin with .git at the end of its name', () => {
|
||||
const expectedPackageDependency: PackageDependency = {
|
||||
currentValue: 'v3.2.7',
|
||||
datasource: 'github-tags',
|
||||
depName: 'some-org/some-plugin',
|
||||
registryUrls: ['https://github.company.com'],
|
||||
};
|
||||
const res = extractPackageFile(Fixtures.get('pipeline6.yml')).deps;
|
||||
expect(res).toHaveLength(1);
|
||||
expect(res).toEqual([expectedPackageDependency]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -43,8 +43,9 @@ export function extractPackageFile(content: string): PackageFile | null {
|
|||
if (gitPluginMatch) {
|
||||
logger.debug('Examining git plugin');
|
||||
const { registry, gitPluginName } = gitPluginMatch.groups;
|
||||
const gitDepName = gitPluginName.replace(regEx('\\.git$'), '');
|
||||
const dep: PackageDependency = {
|
||||
depName: gitPluginName,
|
||||
depName: gitDepName,
|
||||
currentValue: currentValue,
|
||||
registryUrls: ['https://' + registry],
|
||||
datasource: GithubTagsDatasource.id,
|
||||
|
|
Loading…
Reference in a new issue