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: expand regex custom managers to include more files #1072

Merged
merged 1 commit into from
Aug 16, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
automerge: true,
commitMessageTopic: 'references to {{depName}}',
minimumReleaseAge: null,
pinDigests: false,
rebaseWhen: 'behind-base-branch',
schedule: ['before 6am on Monday'],
semanticCommitScope: null,
Expand All @@ -59,25 +60,5 @@
],
datasourceTemplate: 'github-tags',
},
{
customType: 'regex',
datasourceTemplate: 'npm',
fileMatch: [
'(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$',
'(^|/)action\\.ya?ml$',
],
matchStrings: [
'\\snpx (?<depName>.+?)@(?<currentValue>.*?)\\s',
'\\snpm install (?<depName>.+?)@(?<currentValue>.*?)\\s',
],
},
{
customType: 'regex',
datasourceTemplate: 'npm',
fileMatch: ['^\\.github\\/renovate\\.json5$'],
matchStrings: [
'npx\\s+(?<depName>prettier)(?:@(?<currentValue>\\d+\\.\\d+\\.\\d+))?',
],
},
],
}
34 changes: 17 additions & 17 deletions default.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"config:recommended",
":semanticCommits",
":automergeRequireAllStatusChecks",
"docker:enableMajor",
"docker:pinDigests",
"mergeConfidence:age-confidence-badges",
"github>bfra-me/renovate-config:replacements.json5",
"github>bfra-me/renovate-config:vendors/bfra.me"
Expand All @@ -18,45 +20,43 @@
"extends": ["npm:unpublishSafe"],
"prNotPendingHours": 73
},
{
"description": "Enable major version updates for Docker images and pin digests in Dockerfiles and docker-compose.yml",
"extends": ["docker:enableMajor", "docker:pinDigests"],
"matchManagers": ["dockerfile", "docker-compose"]
},
{
"description": "Remove 'v' prefix from `regex` manager version strings",
"matchManagers": ["regex"],
"extractVersion": "^?v?(?<version>\\d+\\.\\d+\\.\\d+.*)$",
"versioning": "regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+.*))?$"
"extractVersion": "^?v?(?<version>\\d+\\.\\d+\\.\\d+)$",
"versioning": "regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$"
}
],
"customManagers": [
{
"customType": "regex",
"description": "Update `version` and <*>`_VERSION` values in GitHub Actions and workflows.",
"fileMatch": [
"^action\\.ya?ml$",
"^\\.github\\/(actions|workflows)\\/[^/]+\\.ya?ml$"
"(^|/)action\\.ya?ml$",
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$"
],
"matchStrings": [
"\\s+version: (?<currentValue>.+?) # renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>.+?))?\\s",
"\\s*[A-Z0-9_]+?_VERSION: (?<currentValue>.+?) # renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>.+?))?\\s"
"\\s+version: (?<currentValue>.+?) # renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>[^\\s]+?))?\\s",
"\\s*[A-Z0-9_]+?_VERSION: (?<currentValue>.+?) # renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>[^\\s]+?))?\\s"
]
},
{
"customType": "regex",
"description": "Update `install-`<*> Buildpack commands and <*>`_VERSION` values in Dockerfiles.",
"fileMatch": ["(^|/|\\.)Dockerfile$", "(^|/)Dockerfile\\.[^/]*$"],
"fileMatch": [
"(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$",
"(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>.+?))?\\s(?:ENV|ARG) .+?_VERSION=(?<currentValue>.+?)\\s",
"# renovate: datasource=(?<datasource>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>.+?))?\\sRUN install-[a-z0-9]+? (?<depName>[a-z0-9-]+?) (?<currentValue>.+?)\\s"
"# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[^\\s]+?))?(?: extractVersion=(?<extractVersion>[^\\s]+?))?(?: registryUrl=(?<registryUrl>[^\\s]+?))?\\s(?:ENV|ARG)\\s+[A-Za-z0-9_]+?_VERSION[ =][\"']?(?<currentValue>.+?)[\"']?\\s",
"# renovate: datasource=(?<datasource>[a-z-.]+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>[^\\s]+?))?\\sRUN install-[a-z0-9]+? (?<depName>[a-z0-9-]+?) (?<currentValue>.+?)\\s"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
{
"customType": "regex",
"description": "Update GitHub Action references in Markdown files.",
"fileMatch": ["\\.md$"],
"fileMatch": ["\\.markdown$", "\\.md$", "\\.mdx$"],
"matchStrings": [
"\\suses: (?<depName>[\\w-]+\\/[\\w-]+)(?<path>\\/.*)?@(?<currentValue>v\\d+\\.\\d+\\.\\d+)",
"\\suses: (?<depName>[\\w-]+\\/[\\w-]+)(?<path>\\/.*)?@(?<currentDigest>[a-z0-9]{40}|[a-z0-9]{64}) # tag=(?<currentValue>v\\d+\\.\\d+\\.\\d+)"
Expand All @@ -67,9 +67,9 @@
{
"customType": "regex",
"description": "Update _VERSION variables in shell scripts.",
"fileMatch": ["\\.sh$"],
"fileMatch": ["\\.bash$", "\\.sh$", "\\.zsh$"],
"matchStrings": [
"# renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?_VERSION=(?<currentValue>.+?)\\s"
"# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>.+?)(?: (?:packageName|lookupName)=(?<packageName>.+?))?(?: versioning=(?<versioning>[^\\s]+?))?\\s+?.+?_VERSION=(?<currentValue>.+?)\\s"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
}
Expand Down
4 changes: 4 additions & 0 deletions vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"customType": "regex",
"datasourceTemplate": "npm",
"fileMatch": [
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
"(^|/)action\\.ya?ml$",
"(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$",
"(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$",
"^renovate\\.json5?$",
"^\\.github\\/renovate\\.json5?$",
"^\\.gitlab\\/renovate\\.json5?$",
Expand Down