Skip to content

Commit

Permalink
feat(presets): allow dots in regexManager presets (#24001)
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Aug 21, 2023
1 parent ba8c2ba commit b02f723
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions lib/config/presets/internal/regex-managers.spec.ts
Expand Up @@ -20,6 +20,9 @@ describe('config/presets/internal/regex-managers', () => {
# renovate: datasource=npm depName=yarn
ENV YARN_VERSION 3.3.1
# renovate: datasource=custom.hashicorp depName=consul
ENV CONSUL_VERSION 1.3.1
RUN echo "FOO"
`;

Expand Down Expand Up @@ -52,6 +55,13 @@ describe('config/presets/internal/regex-managers', () => {
replaceString:
'# renovate: datasource=npm depName=yarn\nENV YARN_VERSION 3.3.1\n',
},
{
currentValue: '1.3.1',
datasource: 'custom.hashicorp',
depName: 'consul',
replaceString:
'# renovate: datasource=custom.hashicorp depName=consul\nENV CONSUL_VERSION 1.3.1\n',
},
]);
});

Expand Down Expand Up @@ -88,6 +98,8 @@ describe('config/presets/internal/regex-managers', () => {
PNPM_VERSION: "7.25.1"
# renovate: datasource=npm depName=yarn
YARN_VERSION: '3.3.1'
# renovate: datasource=custom.hashicorp depName=consul
CONSUL_VERSION: 1.3.1
jobs:
lint:
Expand Down Expand Up @@ -130,6 +142,13 @@ describe('config/presets/internal/regex-managers', () => {
replaceString:
"# renovate: datasource=npm depName=yarn\n YARN_VERSION: '3.3.1'\n",
},
{
currentValue: '1.3.1',
datasource: 'custom.hashicorp',
depName: 'consul',
replaceString:
'# renovate: datasource=custom.hashicorp depName=consul\n CONSUL_VERSION: 1.3.1\n',
},
]);
});

Expand Down
4 changes: 2 additions & 2 deletions lib/config/presets/internal/regex-managers.ts
Expand Up @@ -12,7 +12,7 @@ export const presets: Record<string, Preset> = {
'(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$',
],
matchStrings: [
'# renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>[^\\s]+?)(?: (lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[^\\s]+?))?(?: registryUrl=(?<registryUrl>[^\\s]+?))?\\s(?:ENV|ARG) .+?_VERSION[ =]"?(?<currentValue>.+?)"?\\s',
'# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[^\\s]+?))?(?: registryUrl=(?<registryUrl>[^\\s]+?))?\\s(?:ENV|ARG) .+?_VERSION[ =]"?(?<currentValue>.+?)"?\\s',
],
},
],
Expand All @@ -24,7 +24,7 @@ export const presets: Record<string, Preset> = {
{
fileMatch: ['^.github/(?:workflows|actions)/.+\\.ya?ml$'],
matchStrings: [
'# renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?\\s+[A-Za-z0-9_]+?_VERSION\\s*:\\s*["\']?(?<currentValue>.+?)["\']?\\s',
'# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?\\s+[A-Za-z0-9_]+?_VERSION\\s*:\\s*["\']?(?<currentValue>.+?)["\']?\\s',
],
},
],
Expand Down

0 comments on commit b02f723

Please sign in to comment.