From c8b6950f989d54e0a0cb99c71d6df0df31fb058b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0alata?= Date: Fri, 2 Apr 2021 23:57:56 +0200 Subject: [PATCH] Fix chart-releaser condition --- .github/workflows/release-chart.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml index 42a5038..f9f136e 100644 --- a/.github/workflows/release-chart.yaml +++ b/.github/workflows/release-chart.yaml @@ -31,17 +31,20 @@ jobs: id: helm_version_checker continue-on-error: true run: | - newVersion="$(helm show chart helm/imagepullsecret-injector | grep version: | awk '{print $2}')" - helm repo add imagepullsecret-injector https://ysoftdevs.github.io/imagepullsecret-injector helm repo update + newVersion="$(helm show chart helm/imagepullsecret-injector | grep version: | awk '{print $2}')" + echo "Trying to upload version $newVersion" uploadedVersions="$(helm search repo imagepullsecret-injector/imagepullsecret-injector -l | tail -n +2 | awk '{print $2}')" + echo "Found these versions in upstream: $uploadedVersions" for uploadedVersion in $uploadedVersions; do if [ "$newVersion" == "$uploadedVersion" ]; then + echo "Found a matching version in upstream, failing this task and skipping the release" exit 1 fi done + echo "No matching version found, running the release" - name: Run chart-releaser if: steps.helm_version_checker.outcome == 'success'