File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
export/projects/sample-project/databases/hr_prod Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5555 echo "URL: $url"
5656 echo "Method: $method"
5757
58- # Store response in a temporary file to avoid string manipulation issues
59- local temp_file=$(mktemp)
60- local http_code=$(curl -s -w "%{http_code}" \
58+ # Store response in a temporary file
59+ temp_file=$(mktemp)
60+ http_code=$(curl -s -w "%{http_code}" \
6161 --request "$method" "$url" \
6262 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
6363 --header "Content-Type: application/json" \
@@ -77,15 +77,16 @@ jobs:
7777 fi
7878
7979 # Validate JSON response
80- if ! python3 -c "
80+ if ! python3 << 'EOF'
8181import sys, json
8282try :
83- with open('$temp_file' , 'r') as f :
83+ with open(sys.argv[1] , 'r') as f :
8484 json.load(f)
8585except json.JSONDecodeError as e :
8686 print(f'Invalid JSON : {str(e)}', file=sys.stderr)
8787 sys.exit(1)
88- " 2>/dev/null; then
88+ EOF
89+ " $temp_file" 2>/dev/null; then
8990 echo "Error : Invalid JSON response"
9091 rm "$temp_file"
9192 return 1
Original file line number Diff line number Diff line change 1+ SELECT * FROM employee;
You can’t perform that action at this time.
0 commit comments