From 055e2d7447c840b0836efc774327f1b4aa8b1e25 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 18 Jun 2026 13:29:06 +0200 Subject: [PATCH] fix(ci): gracefully handle priority-gate api errors --- scripts/priority-gate.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/priority-gate.sh b/scripts/priority-gate.sh index 14eebdef5..88f255231 100755 --- a/scripts/priority-gate.sh +++ b/scripts/priority-gate.sh @@ -22,11 +22,12 @@ API_BASE="https://git.infra.mintel.me/api/v1/repos/$GITHUB_REPOSITORY/actions/ru LIMIT=50 RESPONSE=$(curl -s -H "Authorization: token $GITEA_PAT" "$API_BASE?limit=$LIMIT") -# Verify response is valid JSON -if ! echo "$RESPONSE" | jq empty 2>/dev/null; then - echo "Failed to parse API response from Gitea." +# Verify response is a valid JSON array +if ! echo "$RESPONSE" | jq -e 'type == "array"' >/dev/null 2>&1; then + echo "Failed to parse API response from Gitea (not an array) or API error." echo "$RESPONSE" - exit 1 + echo "Bypassing priority gate gracefully." + exit 0 fi # Use jq to extract running or waiting jobs that are NOT the current one