Replace substring in package name/branchName #26234
-
How are you running Renovate?Self-hosted If you're self-hosting Renovate, tell us what version of Renovate you run.37.90.1 If you're self-hosting Renovate, select which platform you are using.GitLab self-hosted What is your question?In our company, we are using a Docker proxy to reduce the amount of images downloaded from the Docker hub directly. This means, all our images are declared using the Docker registry URL like, e.g., FROM harbor.example.com/docker/library/nginx:1.25.3-alpine-slim in Dockerfiles or image: harbor.example.com/docker/library/maven:3.9.5-eclipse-temurin-17 in our .gitlab-ci.yml. This leads to Renovate adding the URL-prefix to the package name and thus to the title, and branch names as well: Is there a way to remove the "harbor.example.com/docker/library/" part? I tried to at least remove it from the {
// Remove the Docker proxy url from the branch name.
matchPackagePatterns: ["^harbor.example.com/docker/library/"],
branchName: "{{{branchPrefix}}}{{{additionalBranchPrefix}}}{{{replace 'harbor\.example\.com-docker-library-' '' branchTopic}}}",
}, This did not work (Is there some kind of mistake, perhaps?). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
try registry aliases https://docs.renovatebot.com/configuration-options/#registryaliases |
Beta Was this translation helpful? Give feedback.
I got it working now. It seems that I had to reverse the aliases from
"docker.io": "harbor.example.com/docker"
to"harbor.example.com/docker": "docker.io"
!The Packages are now displayed as
docker.io/...
While in the code, only the version is updated. 🎉