docs: fix replacementNameTemplate samples (#21085)

This commit is contained in:
Michael Kriese 2023-03-22 13:05:02 +01:00 committed by GitHub
parent 326e0568b1
commit 7601eb3351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2231,8 +2231,8 @@ For example, the following package rule can be used to replace the registry for
"packageRules": [
{
"matchDatasources": ["docker"],
"matchPackagePatterns": ["^docker.io/.*)"],
"replacementNameTemplate": "{{{replace 'docker.io/' 'ghcr.io/' packageName}}}"
"matchPackagePatterns": ["^docker\\.io/.+"],
"replacementNameTemplate": "{{{replace 'docker\\.io/' 'ghcr.io/' packageName}}}"
}
]
}
@ -2246,13 +2246,13 @@ Or, to add a registry prefix to any `docker` images that do not contain an expli
{
"description": "official images",
"matchDatasources": ["docker"],
"matchPackagePatterns": ["^[a-z-]+(:|$).*"],
"matchPackagePatterns": ["^[a-z-]+$"],
"replacementNameTemplate": "some.registry.org/library/{{{packageName}}}"
},
{
"description": "non-official images",
"matchDatasources": ["docker"],
"matchPackagePatterns": ["^[a-z-]+\\/[a-z-]+(:|$).*"],
"matchPackagePatterns": ["^[a-z-]+/[a-z-]+$"],
"replacementNameTemplate": "some.registry.org/{{{packageName}}}"
}
]