Help with regex manager + autoReplaceStringTemplates #21094
-
How are you running Renovate?Mend Renovate hosted app on github.com If you're self-hosting Renovate, tell us what version of Renovate you run.No response If you're self-hosting Renovate, select which platform you are using.None If you're self-hosting Renovate, tell us what version of the platform you run.No response Was this something which used to work for you, and then stopped?It used to work, and then stopped Wanted end result.autoReplaceStringTemplate updates to "stick" What you tried so far.Not exactly sure if the below is related to https://github.com/renovatebot/renovate/issues/19844 - looks like a slightly different issue... Recreation repository: https://github.com/setchy/renovate-bitbucket-pipelines When debugging locally, the replacement does succeed, however during the below step when it confirms the update it fails to perform the new extract, which results in renovate/lib/workers/repository/update/branch/auto-replace.ts Lines 17 to 31 in ba64726 when bypassing this check locally, it produces the PR I am expecting - https://github.com/setchy/renovate-bitbucket-pipelines/pull/2/files Relevant debug logsLogs
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
What am I overlooking in the regexManager rule which would allow the |
Beta Was this translation helpful? Give feedback.
-
Re-reading docs: Using regexManager to update the dependency name in addition to version along with some trial and error, and finally got there What I learnt
resulting regexManager config "regexManagers": [
{
"description": "Bitbucket Pipelines: update to use authenticated image structure",
"fileMatch": ["(^|\\/|\\.)bitbucket-pipelines.ya?ml$"],
"matchStringsStrategy": "combination",
"matchStrings": [
"[ \\t]*image:\\s+(?<depName>[a-z-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?",
"[ \\t]*image:\\s+\\n\\s+name:\\s+(?<depName>[a-z-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?\\s+username:\\s+\\$SOME_USER\\s+password:\\s+\\$SOME_PASSWORD\\s+email:\\s+\\$SOME_EMAIL"
],
"datasourceTemplate": "docker",
"autoReplaceStringTemplate": "image:\n name: {{{packageName}}}{{#if newValue}}:{{{newValue}}}{{/if}}{{#if newDigest}}@{{{newDigest}}}{{/if}}\n username: $SOME_USER\n password: $SOME_PASSWORD\n email: $SOME_EMAIL"
}
] |
Beta Was this translation helpful? Give feedback.
-
Improved with the release of indentation capture groups "regexManagers": [
{
"description": "Bitbucket Pipelines: update to use authenticated image structure",
"fileMatch": [
"(^|\\/|\\.)bitbucket-pipelines.ya?ml$"
],
"matchStringsStrategy": "combination",
"matchStrings": [
"(?<indentation>[ \\t]*)image:\\s+(?<depName>[a-z-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?",
"(?<indentation>[ \\t]*)image:\\n\\s+name:\\s+(?<depName>[a-z-]+)(?::(?<currentValue>[a-z0-9.-]+))?(?:@(?<currentDigest>sha256:[a-f0-9]+))?\\n\\s+username: \\$SOME_USER\\n\\s+password: \\$SOME_PASSWORD\\n\\s+email: \\$SOME_EMAIL"
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker",
"autoReplaceStringTemplate": "{{{indentation}}}image:\n{{{indentation}}} name: {{packageName}}{{#if newValue}}:{{{newValue}}}{{/if}}{{#if newDigest}}@{{{newDigest}}}{{/if}}\n{{{indentation}}} username: $SOME_USER\n{{{indentation}}} password: $SOME_PASSWORD\n{{{indentation}}} email: $SOME_EMAIL"
}
] |
Beta Was this translation helpful? Give feedback.
Improved with the release of indentation capture groups