From e780c39b79f649948b5fdb87f801bb3396a356b5 Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Mon, 10 Jun 2024 10:58:42 +0200
Subject: [PATCH] Add script for renovate to upgrade OpenTofu versions

---
 .gitlab/scripts/renovate-post-upgrade.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 .gitlab/scripts/renovate-post-upgrade.sh

diff --git a/.gitlab/scripts/renovate-post-upgrade.sh b/.gitlab/scripts/renovate-post-upgrade.sh
new file mode 100644
index 0000000..a3bfbda
--- /dev/null
+++ b/.gitlab/scripts/renovate-post-upgrade.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+# This script is just used to add the `latest_version` to the
+# list of supported versions because natively that is
+# cumbersome to achieve.
+
+script_dir="$(dirname "$0")"
+project_dir="$script_dir/../.."
+
+yq --inplace '.".data".supported_versions = ([.".data".latest_version] + .".data".supported_versions | unique)' "$project_dir/opentofu_versions.yaml"
+
+"$script_dir/update-opentofu-versions.sh"
-- 
GitLab