From e15e7e88f3a3400dc630e8947b0c48dff4602899 Mon Sep 17 00:00:00 2001
From: Nacho Barrientos <nacho.barrientos@cern.ch>
Date: Mon, 17 Mar 2025 12:10:22 +0100
Subject: [PATCH] Add CI job to fail if README.md needs to be regenerated

---
 .gitlab-ci.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f74bfc..2c3de19 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,6 +7,7 @@ include:
 
 stages:
   - lint
+  - validate
   - test
   - build
   - deploy
@@ -44,6 +45,17 @@ helm_lint:
     - helm dep update .
     - helm lint --strict .
 
+helm_docs_needs_running:
+  stage: validate
+  image: registry.cern.ch/docker.io/jnorwood/helm-docs:v1.14.2
+  rules:
+    - if: '$CI_COMMIT_TAG'
+      when: never
+    - if: $CI_PIPELINE_SOURCE == "push"
+  script:
+    - helm-docs -o test.md
+    - diff -ura test.md README.md
+
 unittest:
   stage: test
   image: registry.cern.ch/docker.io/helmunittest/helm-unittest:3.17.0-0.7.2
-- 
GitLab