File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ jobs:
53
53
echo "Description: $description"
54
54
echo "URL: $url"
55
55
echo "Method: $method"
56
+ echo "Data: $data"
56
57
57
58
temp_file=$(mktemp)
58
- http_code=$(curl -s -w "%{http_code}" \
59
+ http_code=$(curl -v - s -w "%{http_code}" \
59
60
--request "$method" "$url" \
60
61
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
61
62
--header "Content-Type: application/json" \
62
63
--data "$data" \
63
- -o "$temp_file")
64
+ -o "$temp_file" 2>&1 )
64
65
65
66
echo "=== DEBUG: Response Details ==="
66
67
echo "HTTP Status: $http_code"
70
71
71
72
if [[ $http_code -lt 200 || $http_code -ge 300 ]]; then
72
73
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"
73
90
rm "$temp_file"
74
91
return 1
75
92
fi
You can’t perform that action at this time.
0 commit comments