From 31d36bd1835ef9f179750bb91cbf899acef13de2 Mon Sep 17 00:00:00 2001 From: cinco euzebio Date: Sat, 28 Feb 2026 21:44:08 -0300 Subject: [PATCH] ci: add debug output to coverage upload step --- .drone.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 15261fd..b76ff8d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -32,11 +32,14 @@ steps: else COLOR="red"; fi curl -sf "https://img.shields.io/badge/coverage-${PCT}%25-${COLOR}.svg" -o coverage.svg - | + echo "Badge size: $(wc -c < coverage.svg) bytes" SHA=$(curl -sf \ -H "Authorization: token $GITEA_TOKEN" \ "https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg?ref=master" \ - | jq -r '.sha // empty') + | jq -r '.sha // empty' || echo "") + echo "Existing SHA: '${SHA}'" CONTENT=$(base64 -w 0 coverage.svg) + echo "Content length: ${#CONTENT}" if [ -n "$SHA" ]; then PAYLOAD=$(jq -n --arg msg "ci: update coverage badge [CI SKIP]" \ --arg content "$CONTENT" --arg sha "$SHA" --arg branch "master" \ @@ -46,11 +49,13 @@ steps: --arg content "$CONTENT" --arg branch "master" \ '{message: $msg, content: $content, branch: $branch}') fi - curl -fsSL -X PUT \ + RESPONSE=$(curl -s -X PUT \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ "https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg" \ - -d "$PAYLOAD" + -d "$PAYLOAD") + echo "API response: $RESPONSE" + echo "$RESPONSE" | jq -e '.content.sha' > /dev/null --- kind: pipeline