From e344b538f1b85c6a4fb0fb4f852a6fabb07392e1 Mon Sep 17 00:00:00 2001
From: strophy <32928115+strophy@users.noreply.github.com>
Date: Thu, 15 Dec 2022 17:48:43 +1100
Subject: [PATCH] docs: add readme and regex example for git-refs datasource
 (#19368)

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
---
 lib/modules/datasource/git-refs/readme.md | 25 +++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 lib/modules/datasource/git-refs/readme.md

diff --git a/lib/modules/datasource/git-refs/readme.md b/lib/modules/datasource/git-refs/readme.md
new file mode 100644
index 0000000000..b0a9b2d27a
--- /dev/null
+++ b/lib/modules/datasource/git-refs/readme.md
@@ -0,0 +1,25 @@
+This datasource can be used in combination with [regex managers](https://docs.renovatebot.com/modules/manager/regex/) to keep dependencies up-to-date which are not specifically supported by Renovate.
+
+This datasource returns a reference from a Git repository.
+The `depName` (or `packageName` if in use) must be a fully qualified domain name.
+To fetch the latest digest of a reference instead of the named reference, specify the reference as the `currentValue` and match on the `currentDigest`.
+
+**Usage example**
+
+The following is an example where you would maintain the HEAD digest of the `master` branch of a repository.
+You would configure a generic regex manager in `renovate.json` for files named `versions.ini`:
+
+```json
+{
+  "regexManagers": [
+    {
+      "fileMatch": ["^versions.ini$"],
+      "matchStrings": ["GOOGLE_API_VERSION=(?<currentDigest>.*?)\\n"],
+      "currentValueTemplate": "master",
+      "depNameTemplate": "googleapis",
+      "packageNameTemplate": "https://github.com/googleapis/googleapis",
+      "datasourceTemplate": "git-refs"
+    }
+  ]
+}
+```
-- 
GitLab