From fe37570d02504f098d863f1ba7b0b4158fa57aa9 Mon Sep 17 00:00:00 2001
From: mptr <5887228-mptr@users.noreply.gitlab.com>
Date: Wed, 18 Sep 2024 21:56:09 +0200
Subject: [PATCH] docs: add renovate section

---
 .gitlab/README.md.template | 48 ++++++++++++++++++++++++++++++++++++++
 README.md                  | 48 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+)

diff --git a/.gitlab/README.md.template b/.gitlab/README.md.template
index d0fc0ec..849b65d 100644
--- a/.gitlab/README.md.template
+++ b/.gitlab/README.md.template
@@ -280,6 +280,54 @@ However, we cannot use the alternative `+` which would indicate build metadata
 as we'd like.
 See https://github.com/distribution/distribution/issues/1201*
 
+### Using with Renovate
+
+To keep the component versions up to date you could use [Renovate](https://docs.renovatebot.com/).
+
+Renovate users who use the component input `opentofu_version` should include the following `extends`
+so that the OpenTofu version is raised to a maximum of the version suitable for the component:
+
+```json
+{
+  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+  "extends": ["local>components/opentofu"],
+  ...
+}
+```
+(You may need to adjust the path to the `components/opentofu` to match your mirror.)
+Fore more details refer to the [Renovate documentation](https://docs.renovatebot.com/config-presets/).
+
+Some more example configurations for your `renovate.json`:
+
+- Package Rule to update all CI-Components
+  ```json
+  {
+			"matchFileNames": [
+				".gitlab-ci.yaml",
+        ".gitlab-ci.yml",
+				"templates/**/*.yaml",
+        "templates/**/*.yml"
+			],
+			"groupName": "Pipeline",
+			"semanticCommitType": "ci",
+			"automerge": true
+	},
+  ```
+- Package rule to pin only `major.minor` versions:
+  ```json
+  {
+		  "matchManagers": ["gitlabci"],
+		  "extractVersion": "^(?<version>\\d+\\.\\d+)"
+	},
+  ```
+- Package rule to target a specific component:
+  ```json
+  {
+      "matchPackageNames": ["components/opentofu"],
+      "matchManagers": ["gitlabci"]
+  },
+  ```
+
 ## Usage on self-managed
 
 GitLab CI/CD components are not yet distributed and available on self-managed GitLab instances.
diff --git a/README.md b/README.md
index 7db20ca..d4d5a38 100644
--- a/README.md
+++ b/README.md
@@ -297,6 +297,54 @@ However, we cannot use the alternative `+` which would indicate build metadata
 as we'd like.
 See https://github.com/distribution/distribution/issues/1201*
 
+### Using with Renovate
+
+To keep the component versions up to date you could use [Renovate](https://docs.renovatebot.com/).
+
+Renovate users who use the component input `opentofu_version` should include the following `extends`
+so that the OpenTofu version is raised to a maximum of the version suitable for the component:
+
+```json
+{
+  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+  "extends": ["local>components/opentofu"],
+  ...
+}
+```
+(You may need to adjust the path to the `components/opentofu` to match your mirror.)
+Fore more details refer to the [Renovate documentation](https://docs.renovatebot.com/config-presets/).
+
+Some more example configurations for your `renovate.json`:
+
+- Package Rule to update all CI-Components
+  ```json
+  {
+			"matchFileNames": [
+				".gitlab-ci.yaml",
+        ".gitlab-ci.yml",
+				"templates/**/*.yaml",
+        "templates/**/*.yml"
+			],
+			"groupName": "Pipeline",
+			"semanticCommitType": "ci",
+			"automerge": true
+	},
+  ```
+- Package rule to pin only `major.minor` versions:
+  ```json
+  {
+		  "matchManagers": ["gitlabci"],
+		  "extractVersion": "^(?<version>\\d+\\.\\d+)"
+	},
+  ```
+- Package rule to target a specific component:
+  ```json
+  {
+      "matchPackageNames": ["components/opentofu"],
+      "matchManagers": ["gitlabci"]
+  },
+  ```
+
 ## Usage on self-managed
 
 GitLab CI/CD components are not yet distributed and available on self-managed GitLab instances.
-- 
GitLab