1

I am trying renovate plugin in our github repositories to update the dependencies version. For this we tried a regular expression like below in the renovate.json

 
      "matchStringsStrategy": "any",
      "matchStrings": [        
        "pipeline-certificate1-(?<currentValue>[^_]+)\\.crt",
        "pipeline-certificate2-(?<currentValue>[^_]+)\\.crt",
        "pipeline-certificate3-(?<currentValue>[^_]+)\\.crt"
      ]

and here is my code in the file:

'pipeline-certificate1-1.0.0.crt': 'value1',
'pipeline-certificate2-1.0.0.crt': 'value2',
'pipeline-certificate3-1.0.0.crt': 'value3'

here only the last matched is getting update but not all the three. Could someone help me here how can I update the regular expression to update the version for all the three lines.

Madhuri
  • 101
  • 1
  • 5
  • 11

2 Answers2

1

I updated the regular expression using which I was checking the expression and with that I was able to solve the issue,

"pipeline-certificate-(?<currentValue>.*)-.*\\.crt"

With something similar to above I was able to proceed. Thanks for all the support

Madhuri
  • 101
  • 1
  • 5
  • 11
0

The Custom Manager Support using Regex documentation suggests:

Through the use of the regexManagers config, multiple "regex managers" can be created for the same repository

So I would suggests defining/using multiple regexManagers configuration instead of one with three regexps.

{
  "regexManagers": [
    {
      ...
      "matchStringsStrategy": "any",
      "matchStrings": ["pipeline-certificate1-(?<currentValue>[^_]+)\\.crt"],
      ...
    },
    {
      ...
      "matchStringsStrategy": "any",
      "matchStrings": ["pipeline-certificate2-(?<currentValue>[^_]+)\\.crt"],
      ...
    },
    {
      ...
      "matchStringsStrategy": "any",
      "matchStrings": ["pipeline-certificate3-(?<currentValue>[^_]+)\\.crt"],
      ...
    }
  ]
}
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250