Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(presets): allow dots in regexManager presets #24001

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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