| name | renovate-custom-regex-managers |
| description | Comment-annotation patterns for Renovate to track versions in YAML, Dockerfile, and devcontainer.json files โ patterns from mmalyska/renovate-config |
Renovate Custom Regex Managers
When to Use
Use these annotation patterns when a file contains version strings that Renovate's built-in managers don't detect โ typically Helm values files, Ansible task files, raw Dockerfiles with ARG versions, or Kubernetes manifests that pin tool versions.
The patterns are provided by the generic-regex-manager.json5 and devcontainer-regex-manager.json5 presets in mmalyska/renovate-config (included in the base preset).
Pattern 1: Generic Comment Annotation (YAML / Dockerfile)
Annotate a version field in any .yaml, .yml, or Dockerfile with a comment line directly above it:
cosign_version: v2.2.3
kubectl_image_tag: "1.29.2"
chart_version: "57.2.0"
aws_provider_version: "~> 5.0"
The versioning field is optional; defaults to semver if omitted.
versionTemplate for non-standard formats
When the version field has a prefix/suffix around the version number, use versionTemplate:
TRIVY_VERSION: 0.50.0
kustomize remote URL pattern
For kustomize remote references like github.com/dep/dep/v1.0.0/folder:
bases:
- github.com/owner/repo/v1.0.0/path/to/base
Pattern 2: Docker Image in YAML (with digest)
For YAML files containing image: fields that need digest pinning:
image: docker.io/cloudflare/cloudflared:2024.1.0@sha256:abc123...
image: ghcr.io/mmalyska/my-app:main@sha256:abc123...
The annotation must be on the line directly above the image: field. Renovate will update both the tag and the digest.
Pattern 3: devcontainer.json Image
The devcontainer-regex-manager.json5 preset matches the "image" field in .devcontainer/devcontainer.json:
{
"image": "ghcr.io/mmalyska/home-ops-devcontainer:main@sha256:abc123..."
}
No annotation comment needed โ the manager matches the "image": key directly.
Renovate will open a PR to update the digest when a new image is pushed.
Checking Your Annotations
To verify Renovate will pick up your annotations, run the Renovate debug command locally (requires a Renovate installation):
LOG_LEVEL=debug renovate --token $GITHUB_TOKEN --dry-run owner/repo 2>&1 | grep -A2 "customManagers"
Or check the Renovate Dashboard issue in the repo after pushing โ any unmatched versions will appear as "no update found".
Adding Custom Managers Beyond the Presets
If you need a regex manager the shared presets don't cover, add it in a local override file:
// .github/renovate/customManagers.json5
{
"customManagers": [
{
"customType": "regex",
"description": "Track Go toolchain version in .go-version",
"fileMatch": ["^\\.go-version$"],
"matchStrings": ["(?<currentValue>.+)"],
"depNameTemplate": "golang/go",
"datasourceTemplate": "github-releases",
"versioningTemplate": "semver-coerced"
}
]
}
Reference this in your renovate.json5:
"extends": [
"github>mmalyska/renovate-config",
"local>owner/repo//.github/renovate/customManagers.json5"
]