From 2c9727009d4e3f3af79272277d998ea7bf6ae0ef Mon Sep 17 00:00:00 2001 From: Zadkiel AHARONIAN Date: Fri, 15 Nov 2024 11:54:46 +0100 Subject: [PATCH] ci(helm-docs): fix diff issue in GitHub action check (#362) --- .github/workflows/pull_request.yaml | 9 ++++++--- .pre-commit-config.yaml | 3 +-- README.md | 1 + README.md.gotmpl | 2 -- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 99cebf57..1156c979 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -81,10 +81,13 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{github.event.pull_request.head.sha}} - - name: Run helm-docs and check diff + - name: Run helm-docs uses: losisin/helm-docs-github-action@57d2dc9379d9f0d5d22d2845a62c935d32cddfe2 # v1.3.3 with: - output-file: ./README.md + # Keep args in sync with /.pre-commit-config.yaml + output-file: ./../README.md template-files: ./README.md.gotmpl sort-values-order: file - fail-on-diff: true + - name: Check diff + run: | + git diff --exit-code README.md || { echo; echo "error: README.md is out of date. Please run `make build-docs` and commit the resulting file."; exit 1; } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 582d93ad..c6ca98e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,8 +4,7 @@ repos: hooks: - id: helm-docs-built args: - - --chart-search-root=. - - --values-file=values.yaml + # Keep args in sync with /.github/workflows/pull_request.yaml - --output-file=./../README.md - --template-files=./README.md.gotmpl - --sort-values-order=file diff --git a/README.md b/README.md index 5f3c3b71..75d0da83 100644 --- a/README.md +++ b/README.md @@ -390,6 +390,7 @@ helm delete --namespace test my-application | backup.snapshotVolumes | bool | `true` | Whether to take snapshots of persistent volumes as part of the backup. | | backup.storageLocation | string | `nil` | Name of the backup storage location where the backup should be stored. | | backup.ttl | string | `"1h0m0s"` | How long the Backup should be retained for. | +| backup.includedNamespaces | tpl/list | `[ {{ include "application.namespace" $ }} ]` | List of namespaces to include objects from. | | backup.includedResources | list | `nil` | List of resource types to include in the backup. | | backup.excludedResources | list | `nil` | List of resource types to exclude from the backup. | diff --git a/README.md.gotmpl b/README.md.gotmpl index 8b4809d3..e7d3f7d9 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -30,8 +30,6 @@ helm delete --namespace test my-application {{ template "chart.valuesSection" . }} -{{ template "helm-docs.versionFooter" . }} - ## Naming convention for ConfigMap, Secret, SealedSecret and ExternalSecret Name format of ConfigMap, Secret, SealedSecret and ExternalSecret is `{{`{{ template "application.name" $ }}-{{ $nameSuffix }}`}}` then: