Skip to content

Commit 3fcb818

Browse files
committed
added api-heatlh checker and updated README
1 parent ce4d67d commit 3fcb818

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

.github/workflows/api-health.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ jobs:
1414
run: |
1515
echo "Checking YTS API status..."
1616
17-
RESPONSE=$(curl -s https://yts.mx/api/v2/list_movies.json)
18-
19-
STATUS=$(echo "$RESPONSE" | jq -r '.status')
20-
17+
RESPONSE=$(curl -fsS https://yts.mx/api/v2/list_movies.json) || { echo "Curl failed"; exit 1; }
18+
STATUS=$(echo "$RESPONSE" | jq -e -r '.status') || { echo "Invalid JSON"; echo "$RESPONSE"; exit 1; }
2119
if [ "$STATUS" != "ok" ]; then
2220
echo "❌ API status is NOT ok"
2321
echo "$RESPONSE"
2422
exit 1
2523
fi
26-
2724
echo "✅ API status is OK"

0 commit comments

Comments
 (0)