File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ jobs:
5353 echo "Description: $description"
5454 echo "URL: $url"
5555 echo "Method: $method"
56+ echo "Data: $data"
5657
5758 temp_file=$(mktemp)
58- http_code=$(curl -s -w "%{http_code}" \
59+ http_code=$(curl -v - s -w "%{http_code}" \
5960 --request "$method" "$url" \
6061 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
6162 --header "Content-Type: application/json" \
6263 --data "$data" \
63- -o "$temp_file")
64+ -o "$temp_file" 2>&1 )
6465
6566 echo "=== DEBUG: Response Details ==="
6667 echo "HTTP Status: $http_code"
7071
7172 if [[ $http_code -lt 200 || $http_code -ge 300 ]]; then
7273 echo "Error: Failed $description. Status: $http_code"
74+ cat "$temp_file"
75+ rm "$temp_file"
76+ return 1
77+ fi
78+
79+ if [[ ! -s "$temp_file" ]]; then
80+ echo "Error: Empty response from server"
81+ rm "$temp_file"
82+ return 1
83+ fi
84+
85+ # Simple one-line JSON validation
86+ if ! python3 -c "import json,sys; json.load(open('$temp_file'))" 2>/dev/null; then
87+ echo "Error: Invalid JSON response"
88+ echo "Response content:"
89+ cat "$temp_file"
7390 rm "$temp_file"
7491 return 1
7592 fi
You can’t perform that action at this time.
0 commit comments