From fd4876c680a4f4727d60e988944f84c3cf20972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sun, 21 Jul 2024 14:56:14 +0200 Subject: [PATCH] ci: Add diff pipeline --- .github/workflows/lint-test.yaml | 10 +++++++--- charts/github-actions-runner/templates/config.yaml | 2 +- charts/github-actions-runner/templates/deployment.yaml | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index a0e9384..c9b369d 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -68,10 +68,14 @@ jobs: - name: Run chart-testing (diff) if: steps.list-changed.outputs.changed == 'true' run: | - changed_list=$(echo $changed_list) for chart in $changed_list; do - helm install $chart oci://ghcr.io/${{ github.repository_owner }}/charts/$chart --create-namespace --namespace $chart --wait - helm diff upgrade $chart charts/$chart \ + echo "installing chart: $chart" + chart="${chart#*/}" + + helm install --create-namespace --namespace "${chart}" \ + "${chart}" "oci://ghcr.io/${{ github.repository_owner }}/charts/$chart" + + helm diff upgrade "${chart}" "charts/${chart}" \ --namespace $chart \ --suppress=CustomResourceDefinition \ --normalize-manifests \ diff --git a/charts/github-actions-runner/templates/config.yaml b/charts/github-actions-runner/templates/config.yaml index d6ec2f5..6d96874 100644 --- a/charts/github-actions-runner/templates/config.yaml +++ b/charts/github-actions-runner/templates/config.yaml @@ -6,4 +6,4 @@ metadata: labels: {{- include "github-actions-runner.labels" . | nindent 4 }} data: - {{ .Files.AsConfig "files/*.sh" | nindent 2 }} + {{ (.Files.Glob "files/*.sh").AsConfig | nindent 2 }} diff --git a/charts/github-actions-runner/templates/deployment.yaml b/charts/github-actions-runner/templates/deployment.yaml index 238a908..82e0625 100644 --- a/charts/github-actions-runner/templates/deployment.yaml +++ b/charts/github-actions-runner/templates/deployment.yaml @@ -45,7 +45,7 @@ spec: - "service" env: {{- range $key, $val := .Values.env }} - {{- if ne (eq $val "") }} + {{- if not (eq (print $val) "") }} - name: {{ $key }} value: {{ $val | quote }} {{- end }}