Skip to content

Commit a766715

Browse files
Merge pull request #33 from bytebase/a-branch-6
select
2 parents 5a515c0 + 82634b3 commit a766715

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/bb-export.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ jobs:
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'
8181
import sys, json
8282
try:
83-
with open('$temp_file', 'r') as f:
83+
with open(sys.argv[1], 'r') as f:
8484
json.load(f)
8585
except 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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FROM employee;

0 commit comments

Comments
 (0)