From ba81a3a02426418094a6ad162c146892cb10753c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emil=20K=C3=B8hler=20Warmdahl?= <ekw@concordium.com>
Date: Mon, 2 Dec 2024 10:31:10 +0100
Subject: [PATCH] Try different approach

---
 .github/workflows/release.yaml | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index a39e9267b..6fd8c453b 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -184,16 +184,20 @@ jobs:
           fi
           
           OUT_FILENAME_EXE="${VERSION}/${TARGET_NET}/${FILENAME_EXE}"
-          aws s3 ls ${{ env.S3_BUCKET }}/$OUT_FILENAME_EXE
+          OUT_OBJECT=${{ env.S3_BUCKET }}/$OUT_FILENAME_EXE
+          aws s3 ls $OUT_OBJECT
           EC=$?
-          if [ $EC -eq 0 ]; then
-            echo "Executable already exist"
-            exit 1
-          else
-            echo "OUT_OBJECT=${{ env.S3_BUCKET }}/$OUT_FILENAME_EXE" >> $GITHUB_ENV
+          echo "OUT_OBJECT=$OUT_OBJECT" >> $GITHUB_ENV
+          echo "ERROR_CODE=$EC" >> $GITHUB_ENV
+          if [ EC -eq 0 ]; then
+            echo "$OUT_OBJECT already exist"
+          elif [ $EC -ne 254 ]; then
+            echo "Error: $EC"
           fi
           
+          
       - name: setup
+        if: ${{ env.ERROR_CODE == 254 }}
         shell: bash
         run: |
           # Print system info