Skip to content

Commit 8bbe9bc

Browse files
authored
Update ci.yml
1 parent 42c003c commit 8bbe9bc

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ jobs:
4343
INSTALL_DIR="$HOME/minecraft-server-$MC_VERSION-$SERVER_TYPE"
4444
4545
echo "🌐 Fetching server JAR URL for version $MC_VERSION and type $SERVER_TYPE..."
46-
SERVER_JAR_URL=$(curl -s "https://mcutils.com/api/v1/jars?version=$MC_VERSION&type=$SERVER_TYPE" | jq -r '.url')
46+
API_RESPONSE=$(curl -s "https://mcutils.com/api/v1/jars?version=$MC_VERSION&type=$SERVER_TYPE")
47+
48+
# Debug: Print the raw API response
49+
echo "API Response: $API_RESPONSE"
50+
51+
# Validate JSON using jq
52+
if echo "$API_RESPONSE" | jq empty; then
53+
SERVER_JAR_URL=$(echo "$API_RESPONSE" | jq -r '.url')
54+
else
55+
echo "❌ Error: Invalid JSON response from API."
56+
exit 1
57+
fi
4758

4859
if [ "$SERVER_JAR_URL" == "null" ] || [ -z "$SERVER_JAR_URL" ]; then
4960
echo "❌ Error: Could not find a server JAR for version $MC_VERSION and type $SERVER_TYPE."
@@ -81,4 +92,4 @@ jobs:
8192
- name: Clean Up Server Files
8293
run: |
8394
echo "🧹 Cleaning up server files..."
84-
rm -rf "$HOME/minecraft-server-${{ matrix.mc_version }}-${{ matrix.server_type }}"
95+
rm -rf "$HOME/minecraft-server-${{ matrix.mc_version }}-${{ matrix.server_type }}"

0 commit comments

Comments
 (0)