diff --git a/.github/workflows/validate-helm-docs.yml b/.github/workflows/validate-helm-chart.yml similarity index 58% rename from .github/workflows/validate-helm-docs.yml rename to .github/workflows/validate-helm-chart.yml index 5ffb6c7732..0825910abd 100644 --- a/.github/workflows/validate-helm-docs.yml +++ b/.github/workflows/validate-helm-chart.yml @@ -1,10 +1,13 @@ -name: Validate Helm Docs +name: Validate Helm Chart on: + push: + branches: + - 'main' + - '[0-9]+.[1-9][0-9]*.x' pull_request: branches: - 'main' - paths: - - 'helm/**' + - '[0-9]+.[1-9][0-9]*.x' defaults: run: shell: bash @@ -51,3 +54,38 @@ jobs: echo "" echo "Helm values documentation is correct!" fi + + helm-generation-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Cache build tools + id: cache-build-tools + uses: actions/cache@v3 + with: + path: ./bin + key: build-tools-${{ github.ref_name }} + + - name: Generate current YAML + run: | + helm template helm/chart > current.yaml + + - name: Generate new Helm Chart + run: make helm-package + + - name: Generate new YAML + run: | + helm template helm/chart > new.yaml + + - name: Compare YAML files + run: | + if ! diff -rq current.yaml new.yaml &>/dev/null; then + echo "Helm charts were not re-generated. Please regenerate them using make helm-package" + exit 1 + else + echo "" + echo "There are no changes in the manifests" + fi