From 5c3e9de6668a5ae220dac7704c06ad5658648bd2 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sat, 28 Sep 2024 13:42:09 +0200
Subject: [PATCH] Updated text

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

diff --git a/.gitlab/gen-badge.sh b/.gitlab/gen-badge.sh
index f02d9c4dee..8d4290b83d 100644
--- a/.gitlab/gen-badge.sh
+++ b/.gitlab/gen-badge.sh
@@ -1,5 +1,9 @@
 #!/bin/bash
 GITLAB_URL="https://gitlab.phaidra.org"
-RAW=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}")
-anybadge --label pipeline --value "$(echo ${RAW} | jq --raw-output .detailed_status.text)" failed=red passed=green canceled=darkgray > /tmp/pipeline.svg
-anybadge --label pipeline --value "$(echo ${RAW} | jq --raw-output .coverage)" 70=red 80=orange 90=yellow 95=green > /tmp/coverage.svg
\ No newline at end of file
+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)
+anybadge --label pipeline --value "${PIPELINE_STATUS}" failed=red passed=green canceled=darkgray > /tmp/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)
+if [ "${PIPELINE_COVERAGE}" == "null" ]; then
+  PIPELINE_COVERAGE="unknown"
+fi
+anybadge --label pipeline --value "${PIPELINE_COVERAGE}" unknown=darkgray 70=red 80=orange 90=yellow 95=green > /tmp/coverage.svg
-- 
GitLab