@@ -68,19 +68,37 @@ jobs:
6868 CHANGED_FILE="masking/semantic-type.json"
6969 echo "Processing: $CHANGED_FILE"
7070
71- response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.semantic-types" \
71+ # Check if file exists
72+ if [ ! -f "$CHANGED_FILE" ]; then
73+ echo "Error: $CHANGED_FILE does not exist"
74+ exit 1
75+ fi
76+
77+ # Print file content for debugging
78+ echo "File content:"
79+ cat "$CHANGED_FILE"
80+
81+ response=$(curl -v -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.semantic-types" \
7282 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
83+ --header "Content-Type: application/json" \
7384 --data @"$CHANGED_FILE")
7485
7586 # Extract status code and response body
7687 status_code=$(echo "$response" | tail -n1)
7788 body=$(echo "$response" | sed '$d')
7889
79- echo "status_code=${status_code}"
80- echo "response_body=${body}"
90+ # Save outputs for GitHub Actions
91+ echo "status_code=${status_code}" >> $GITHUB_OUTPUT
92+ echo "response_body<<EOF" >> $GITHUB_OUTPUT
93+ echo "${body}" >> $GITHUB_OUTPUT
94+ echo "EOF" >> $GITHUB_OUTPUT
95+
96+ echo "Status Code: ${status_code}"
97+ echo "Response Body: ${body}"
8198
8299 if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then
83100 echo "Failed with status code: $status_code"
101+ echo "Response body: ${body}"
84102 exit 1
85103 fi
86104
0 commit comments