File tree Expand file tree Collapse file tree 2 files changed +5
-27
lines changed
export/projects/sample-project/databases/hr_prod Expand file tree Collapse file tree 2 files changed +5
-27
lines changed Original file line number Diff line number Diff line change @@ -49,44 +49,22 @@ jobs:
4949 local data="$3"
5050 local description="$4"
5151
52- echo "=== DEBUG: API Call Details ==="
53- echo "Description: $description"
52+ echo "Calling API: $description"
5453 echo "URL: $url"
55- echo "Method: $method"
56- echo "Data: $data"
5754
5855 temp_file=$(mktemp)
59- http_code=$(curl -v - s -w "%{http_code}" \
56+ http_code=$(curl -s -w "%{http_code}" \
6057 --request "$method" "$url" \
6158 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
6259 --header "Content-Type: application/json" \
6360 --data "$data" \
64- -o "$temp_file" 2>&1 )
61+ -o "$temp_file")
6562
66- echo "=== DEBUG: Response Details ==="
67- echo "HTTP Status: $http_code"
68- echo "Response body:"
63+ echo "Response (Status $http_code):"
6964 cat "$temp_file"
70- echo "=========================== "
65+ echo "------------------------ "
7166
7267 if [[ $http_code -lt 200 || $http_code -ge 300 ]]; then
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"
9068 rm "$temp_file"
9169 return 1
9270 fi
File renamed without changes.
You can’t perform that action at this time.
0 commit comments