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 55
55
echo "URL: $url"
56
56
echo "Method: $method"
57
57
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}" \
61
61
--request "$method" "$url" \
62
62
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
63
63
--header "Content-Type: application/json" \
@@ -77,15 +77,16 @@ jobs:
77
77
fi
78
78
79
79
# Validate JSON response
80
- if ! python3 -c "
80
+ if ! python3 << 'EOF'
81
81
import sys, json
82
82
try :
83
- with open('$temp_file' , 'r') as f :
83
+ with open(sys.argv[1] , 'r') as f :
84
84
json.load(f)
85
85
except json.JSONDecodeError as e :
86
86
print(f'Invalid JSON : {str(e)}', file=sys.stderr)
87
87
sys.exit(1)
88
- " 2>/dev/null; then
88
+ EOF
89
+ " $temp_file" 2>/dev/null; then
89
90
echo "Error : Invalid JSON response"
90
91
rm "$temp_file"
91
92
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