Example of git-refs #8402
-
Is there an example of how to use I want to get updates for an git repository, to merge it into my current project. I also don't know if it is even the right datasource to achieve this. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
Are you using the regex manager? I'm not sure we have a use case for git-refs in the codebase currently. |
Beta Was this translation helpful? Give feedback.
-
Yes I'm using the regex manager or at least tried to. I want to build a Docker image for a git repository and rebuild it if the repository gets updated. Here's the config I have for now:
|
Beta Was this translation helpful? Give feedback.
-
If I change
|
Beta Was this translation helpful? Give feedback.
-
For both,
|
Beta Was this translation helpful? Give feedback.
-
If I add The full config now looks like this:
|
Beta Was this translation helpful? Give feedback.
-
Hope you don't mind me borrowing the discussion for an almost identical use case 🙏 I have this regex manager code (thanks for the currentValue/currentDigest hack above, it made me get "customManagers": [
{
"customType": "regex",
"fileMatch": ["^\\.plugin-versions$"],
"matchStrings": [
"(?<depName>\\S+)\\W*(?<packageName>https:\\/\\/github.com\\/[\\S]+)\\W*(?<currentValue>)(?<currentDigest>[a-f0-9]{7,40})"
],
"autoReplaceStringTemplate": "{{{depName}}} {{{packageName}}} {{{newDigest}}}",
"datasourceTemplate": "git-refs",
"versioningTemplate": "git"
}
], And I want Renovate to upgrade the commit sha/digests in the end of this file: With the regex proven like this: And I get job logs finding updates: {
"depName": "pluto",
"packageName": "https://github.com/FairwindsOps/asdf-pluto.git",
"currentDigest": "e30adc6",
"datasource": "git-refs",
"versioning": "git",
"replaceString": "pluto https://github.com/FairwindsOps/asdf-pluto.git e30adc6",
"updates": [
{
"updateType": "digest",
"newDigest": "1e24ad5801a02eecceb46d32d2622b9f54de4535",
"branchName": "renovate/pluto-digest"
}
],
"warnings": []
}, And there are upgrades available: But I get no PRs. Any ideas? |
Beta Was this translation helpful? Give feedback.
If I add
currentValue
as an empty group to the regex and change it to\s+ENV\s*MORTY_VERSION="(?<currentValue>)(?<currentDigest>.*?)"\s+
it works.The full config now looks like this: