Skip to content

Instantly share code, notes, and snippets.

@meise
Last active September 24, 2025 14:04
Show Gist options
  • Select an option

  • Save meise/14c9cd601e2bbe35ca891438575b3b86 to your computer and use it in GitHub Desktop.

Select an option

Save meise/14c9cd601e2bbe35ca891438575b3b86 to your computer and use it in GitHub Desktop.
Renovate customDatasource to get only nginx stable version updates
# renovate: datasource=custom.nginx depName=nginx
ARG NGINX_VERSION=1.26.1
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["Dockerfile"],
"datasourceTemplate": "custom.nginx",
"matchStrings": [
"#\\s*renovate:\\s*(datasource=(?<datasource>.*?) )?depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s*.*?_VERSION=(?<currentValue>.*)"
]
}
],
"customDatasources": {
"nginx": {
"defaultRegistryUrlTemplate": "https://nginx.org/en/download.html",
"format": "html",
"transformTemplates": [
"{ \"releases\": [ $map(releases.$sift(function($v, $k) {$v ~> /tar.gz$/}), function($v) { { \"version\": $match($v.version, /-(\\d+\\.\\d+\\.\\d+)/ ).groups[0], \"changelogUrl\": \"https://nginx.org/en/CHANGES-\" & $string($match($v.version, /-(\\d+\\.\\d+)/ ).groups[0]) } } )[1] ] }"
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment