Skip to content

Commit 0d38a87

Browse files
authored
fix: handle case where only one regex manager exists in renovate config (#9)
1 parent 6f7244d commit 0d38a87

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/index.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,19 @@ describe('Sstart Download Process Tests', () => {
301301
const manager1 = renovateConfig.regexManagers[0];
302302
const manager2 = renovateConfig.regexManagers[1];
303303

304+
// Check if second manager exists
305+
if (!manager2) {
306+
// If only one manager exists, just verify it works correctly
307+
const pattern1 = new RegExp(manager1.matchStrings[0]);
308+
const match1 = actionYmlContent.match(pattern1);
309+
310+
expect(match1).not.toBeNull();
311+
const version1 = match1.groups.currentValue;
312+
expect(version1).toBeDefined();
313+
expect(version1).toMatch(/^\d+\.\d+\.\d+/);
314+
return;
315+
}
316+
304317
const pattern1 = new RegExp(manager1.matchStrings[0]);
305318
const pattern2 = new RegExp(manager2.matchStrings[0]);
306319

0 commit comments

Comments
 (0)