File 0316-gh-Only-trigger-.zip-creation-if-a-.exe-artifact-exi.patch of Package erlang

From 2159399b7b361dda3204258faed3eec6a9adc2b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= <lukas@erlang.org>
Date: Tue, 17 Sep 2024 08:24:27 +0200
Subject: [PATCH] gh: Only trigger .zip creation if a .exe artifact exists

---
 .github/scripts/sync-github-releases.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/scripts/sync-github-releases.sh b/.github/scripts/sync-github-releases.sh
index f64dcdb097..2212ef4c91 100755
--- a/.github/scripts/sync-github-releases.sh
+++ b/.github/scripts/sync-github-releases.sh
@@ -137,8 +137,12 @@ while [ "${TAG_URL}" != "" ]; do
                     *)
                         _asset "otp_win32_${stripped_name}.exe"
                         _asset "otp_win64_${stripped_name}.exe"
-                        _asset "otp_win32_${stripped_name}.zip"
-                        _asset "otp_win64_${stripped_name}.zip"
+                        if echo "${RELEASE}" | jq -er ".assets[] | select(.name == \"otp_win32_${stripped_name}.exe\")" > /dev/null; then
+                            _asset "otp_win32_${stripped_name}.zip"
+                        fi
+                        if echo "${RELEASE}" | jq -er ".assets[] | select(.name == \"otp_win64_${stripped_name}.exe\")" > /dev/null; then
+                            _asset "otp_win64_${stripped_name}.zip"
+                        fi
                         ;;
                 esac
             fi
-- 
2.43.0

openSUSE Build Service is sponsored by