diff --git a/.github/helm-docs.sh b/.github/helm-docs.sh index ba4e737..1f593cd 100755 --- a/.github/helm-docs.sh +++ b/.github/helm-docs.sh @@ -1,6 +1,11 @@ -#!/bin/bash +#!/bin/bash -xe CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/main -- 'charts' | grep '[cC]hart.yaml' | sed -e 's#/[Cc]hart.yaml##g')" +if [[ -z "$CHART_DIRS" ]]; then + echo "No Chart.yaml changes detected, aborting helm-docs" + exit 1 +fi + HELM_DOCS_VERSION="1.11.0" curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e8168c..ba3971d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3.5.0 + with: + fetch-depth: 0 - name: Run helm-docs run: .github/helm-docs.sh install-chart: