Using Renovate to manage updates to go install commands

Featured image for sharing metadata for article

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 installing a non-module import

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #renovate #go.

Also on:

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.