diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 3407c4d52b3c..f6245eae0fc6 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -29,6 +29,7 @@ jobs: changed="$(ct list-changed --config .github/linters/ct.yaml)" if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" + echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT" fi # - name: install helm unittest plugin @@ -48,5 +49,18 @@ jobs: run: kubectl apply -k https://github.com/kubernetes-sigs/gateway-api/config/crd if: steps.list-changed.outputs.changed == 'true' + - name: Apply Prometheus Operator CRDs (unless for charts already installing it) + env: + CHANGED_LIST: ${{ steps.list-changed.outputs.changed_list }} + run: | + # Always run unless only changed chart is one of impacted charts + echo "List is: $CHANGED_LIST" + if [ "$CHANGED_LIST" = '"charts/kube-prometheus-stack"' ] || [ "$CHANGED_LIST" = '"charts/prometheus-operator-crds"' ]; then + echo "Skipping install" + else + helm install prometheus-operator-crds oci://ghcr.io/prometheus-community/charts/prometheus-operator-crds + fi + if: steps.list-changed.outputs.changed == 'true' + - name: Run chart-testing (install) run: ct install --config .github/linters/ct.yaml