From 15b7aa1df10ec0bca3756f1fda6feccce4140460 Mon Sep 17 00:00:00 2001 From: Mahe Tardy Date: Wed, 5 Jun 2024 11:15:01 +0200 Subject: [PATCH] renovate: fix Go postUpgradeTasks for stable branches We recently switched to using the toolchain directive on the main which broke Go updates postUpgradeTasks on stable branches (see #2494 or commit bee5a74c9e233d379ff912f0db5182ac01f828af). Signed-off-by: Mahe Tardy --- .github/renovate.json5 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 72c8ead1e7b..5583f8601cc 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -15,6 +15,7 @@ "^make vendor$", "^make -C install/kubernetes$", "^go mod vendor$", + "^install-tool golang \\$\\(grep -oP '\\^go \\\\K\\.\\+' go\\.mod\\)$", "^install-tool golang \\$\\(grep -oP '\\^toolchain go\\\\K\\.\\+' go\\.mod\\)$" ], // repository configuration @@ -212,11 +213,16 @@ } }, { + // main branch is using the new toolchain directive "groupName": "Go", "matchPackageNames": [ "go", "docker.io/library/golang" ], + "matchBaseBranches": [ + "v1.0", + "v1.1", + ], // postUpgradeTasks is only for when the Go module directives are bumped "postUpgradeTasks": { // We need to trigger a golang install manually here because in some @@ -227,6 +233,27 @@ "executionMode": "branch" }, }, + { + // stable branches are using the go directive + "groupName": "Go", + "matchPackageNames": [ + "go", + "docker.io/library/golang" + ], + "matchBaseBranches": [ + "v1.0", + "v1.1", + ], + // postUpgradeTasks is only for when the Go module directives are bumped + "postUpgradeTasks": { + // We need to trigger a golang install manually here because in some + // cases it might not be preinstalled, see: + // https://github.com/renovatebot/renovate/discussions/23485 + "commands": ["install-tool golang $(grep -oP '^go \\K.+' go.mod)", "make vendor"], + "fileFilters": ["**/**"], + "executionMode": "branch" + }, + }, { // Group golangci-lint updates to overrule grouping of version updates in // the GHA files. Without this, golangci-lint updates are not in sync for