Using Renovate to manage updates to go install
commands
As mentioned in Using Renovate to manage updates to golangci-lint
versions, Renovate is great for managing your dependency updates.
By using the custom regex manager, we can craft the following Renovate configuration:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"regexManagers": [
{
"fileMatch": [
".sh$"
],
"matchStrings": [
"go install (?<depName>[^@]+?)@(?<currentValue>[0-9.-a-zA-Z]+)"
],
"datasourceTemplate": "go"
}
]
}
This then allows us to take commands such as:
go install github.com/deepmap/oapi-codegen@v1.11.0
Note that this will not try and update dependencies that aren't pointing to tags, such as @latest
, @HEAD
or pointing to a Git SHA.
Note This doesn't currently work for anything go install
ing a non-module import