Skip to content

Commit e8119b0

Browse files
update
1 parent a0ab79d commit e8119b0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/bb-export.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ jobs:
5151
local description="$4"
5252
5353
echo "Making $description API call..."
54+
echo "URL: $url"
55+
echo "Method: $method"
56+
echo "Data: $data"
57+
5458
response=$(curl -s -w "\n%{http_code}" \
5559
--request "$method" "$url" \
5660
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
@@ -61,12 +65,25 @@ jobs:
6165
body=$(echo "$response" | sed '$d')
6266
6367
echo "Status code: $status_code"
68+
echo "Response body: $body"
69+
6470
if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then
6571
echo "Failed $description. Status: $status_code"
6672
echo "Response: $body"
6773
return 1
6874
fi
6975
76+
if [[ -z "$body" ]]; then
77+
echo "Empty response body"
78+
return 1
79+
fi
80+
81+
# Validate JSON response
82+
if ! echo "$body" | python3 -c "import sys, json; json.load(sys.stdin)" > /dev/null 2>&1; then
83+
echo "Invalid JSON response"
84+
return 1
85+
fi
86+
7087
echo "$body"
7188
return 0
7289
}

0 commit comments

Comments
 (0)