Renovate plugin is not updating all the match strin dependencies

Viewed 47

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.

2 Answers

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

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"],
      ...
    }
  ]
}
Related