mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
fix(buildkite): Catch '?' yaml syntax for plugins (#15666)
This commit is contained in:
parent
ab80d6e672
commit
1b28501d30
3 changed files with 16 additions and 1 deletions
4
lib/modules/manager/buildkite/__fixtures__/pipeline8.yml
Normal file
4
lib/modules/manager/buildkite/__fixtures__/pipeline8.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ? ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7
|
||||
: enforce_peer_deps: false
|
|
@ -60,5 +60,16 @@ describe('modules/manager/buildkite/extract', () => {
|
|||
};
|
||||
expect(res).toEqual([expectedPackageDependency]);
|
||||
});
|
||||
|
||||
it('extracts plugin with preceding ?', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline8.yml'))?.deps;
|
||||
const expectedPackageDependency: PackageDependency = {
|
||||
currentValue: 'v3.2.7',
|
||||
datasource: 'github-tags',
|
||||
depName: 'some-org/some-plugin',
|
||||
registryUrls: ['https://github.company.com'],
|
||||
};
|
||||
expect(res).toEqual([expectedPackageDependency]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export function extractPackageFile(content: string): PackageFile | null {
|
|||
for (const line of lines) {
|
||||
// Search each line for plugin names
|
||||
const depLineMatch = regEx(
|
||||
/^[\s-]*(?<depName>[^#\s]+)#(?<currentValue>[^:]+)/
|
||||
/^\s*(?:-\s+(?:\?\s+)?)?(?<depName>[^#\s]+)#(?<currentValue>[^:]+)/
|
||||
).exec(line);
|
||||
|
||||
if (depLineMatch?.groups) {
|
||||
|
|
Loading…
Reference in a new issue