From ab3df06aa00c225639b17680de593f96c9f2629b Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Thu, 29 Aug 2024 13:58:14 +0200 Subject: [PATCH] ci: add github action to check if helm docs is updated --- .github/workflows/helm-docs.yaml | 49 +++++++++++++++++++++++++++++++ charts/balance-checker/Chart.yaml | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/helm-docs.yaml diff --git a/.github/workflows/helm-docs.yaml b/.github/workflows/helm-docs.yaml new file mode 100644 index 00000000..ade903a6 --- /dev/null +++ b/.github/workflows/helm-docs.yaml @@ -0,0 +1,49 @@ +name: Check Helm Docs + +on: + pull_request: + paths: + - 'charts/**' # Only trigger on changes to charts + +jobs: + check-helm-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Go environment + uses: actions/setup-go@v4 + with: + go-version: '1.23' # Ensure you have a suitable Go version + + - name: Install helm-docs + run: | + go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest + + - name: Run helm-docs + run: | + helm-docs + + - name: Check for uncommitted changes + run: | + git diff --exit-code + continue-on-error: true + id: git_diff + + - name: Display differences if found + if: steps.git_diff.outcome == 'failure' + run: | + echo "The following changes were detected:" + git diff + + - name: Fail if helm-docs changes were needed + if: steps.git_diff.outcome == 'failure' + run: | + echo "::error::helm-docs was not applied or is outdated" + exit 1 + + - name: Success message + if: steps.git_diff.outcome == 'success' + run: | + echo "helm-docs is up-to-date" \ No newline at end of file diff --git a/charts/balance-checker/Chart.yaml b/charts/balance-checker/Chart.yaml index 21789820..440c41bb 100644 --- a/charts/balance-checker/Chart.yaml +++ b/charts/balance-checker/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: balance-checker helm charts name: balance-checker -version: 0.0.1 +version: 0.0.3 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: