Skip to content

Commit bab3ac3

Browse files
Merge pull request #90 from bytebase/a-branch-24
update
2 parents cdbdec7 + a6cf760 commit bab3ac3

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/4-bb-export.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ jobs:
120120
echo "DEBUG: Raw API Response:"
121121
echo "$response"
122122
123-
# Only try to parse as JSON if we have a response
124-
if [ -n "$response" ]; then
125-
SHEET_NAME=$(echo "$response" | python3 -c "import sys, json; print(json.load(sys.stdin).get('name', ''))" || echo "")
126-
echo "DEBUG: Sheet name: $SHEET_NAME"
127-
else
128-
echo "ERROR: Empty response from API"
129-
exit 1
130-
fi
123+
# Option 1: Using grep and cut
124+
SHEET_NAME=$(echo "$response" | grep -o '"name":"[^"]*"' | cut -d'"' -f4)
125+
126+
# Option 2: Using sed
127+
# SHEET_NAME=$(echo "$response" | sed -n 's/.*"name":"\([^"]*\)".*/\1/p')
128+
129+
# Option 3: Using jq if available
130+
# SHEET_NAME=$(echo "$response" | jq -r '.name')
131+
132+
echo "DEBUG: Retrieved sheet name: $SHEET_NAME"
131133
132134
echo "finishing sheetname ================================================"
133135

0 commit comments

Comments
 (0)