fix(ci): gracefully handle priority-gate api errors
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 3s
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 3s
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user