From dfb47f6336cc88a057ff6b191d2b88b9239d76c2 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sat, 28 Sep 2024 15:13:28 +0200
Subject: [PATCH] Attempt #420

---
 .gitlab/gen-badge.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/.gitlab/gen-badge.sh b/.gitlab/gen-badge.sh
index d5dd61b784..0c419dc4b3 100644
--- a/.gitlab/gen-badge.sh
+++ b/.gitlab/gen-badge.sh
@@ -1,12 +1,11 @@
 #!/bin/bash
 GITLAB_URL="https://gitlab.phaidra.org"
-PIPELINE_STATUS=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .detailed_status.text)
-echo "[INFO] pipeline status: ${PIPELINE_STATUS}"
-anybadge --label pipeline --value "${PIPELINE_STATUS}" failed=red passed=green canceled=darkgray > "./final/${APP_VERSION}/images/pipeline.svg"
+# if we reached this script, all the tests have passed
+anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${APP_VERSION}/images/pipeline.svg"
 PIPELINE_COVERAGE=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .coverage)
 echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}"
 if [ "${PIPELINE_COVERAGE}" != "null" ]; then
-  anybadge --label pipeline --value "${PIPELINE_COVERAGE}" unknown=darkgray 70=red 80=orange 90=yellow 95=green > "./final/${APP_VERSION}/images/coverage.svg"
+  anybadge --label pipeline --value "${PIPELINE_COVERAGE}" 70=red 80=orange 90=yellow 95=green > "./final/${APP_VERSION}/images/coverage.svg"
 else
   echo "[WARNING] Skipping badge generation, displaying default badge text: unknown"
 fi
-- 
GitLab