From d82ee8d75ba2687f9c96158b64a7ea285b489d52 Mon Sep 17 00:00:00 2001 From: adela Date: Wed, 15 Jan 2025 17:37:54 +0800 Subject: [PATCH] update --- .../bb-masking-semantic-type-global.yml | 24 ++++++++++++++++--- masking/semantic-type.json | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bb-masking-semantic-type-global.yml b/.github/workflows/bb-masking-semantic-type-global.yml index 8f4dbb1..d78ead4 100644 --- a/.github/workflows/bb-masking-semantic-type-global.yml +++ b/.github/workflows/bb-masking-semantic-type-global.yml @@ -68,19 +68,37 @@ jobs: CHANGED_FILE="masking/semantic-type.json" echo "Processing: $CHANGED_FILE" - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.semantic-types" \ + # Check if file exists + if [ ! -f "$CHANGED_FILE" ]; then + echo "Error: $CHANGED_FILE does not exist" + exit 1 + fi + + # Print file content for debugging + echo "File content:" + cat "$CHANGED_FILE" + + response=$(curl -v -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.semantic-types" \ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ + --header "Content-Type: application/json" \ --data @"$CHANGED_FILE") # Extract status code and response body status_code=$(echo "$response" | tail -n1) body=$(echo "$response" | sed '$d') - echo "status_code=${status_code}" - echo "response_body=${body}" + # Save outputs for GitHub Actions + echo "status_code=${status_code}" >> $GITHUB_OUTPUT + echo "response_body<> $GITHUB_OUTPUT + echo "${body}" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + echo "Status Code: ${status_code}" + echo "Response Body: ${body}" if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then echo "Failed with status code: $status_code" + echo "Response body: ${body}" exit 1 fi diff --git a/masking/semantic-type.json b/masking/semantic-type.json index 97bdc12..f03e55c 100644 --- a/masking/semantic-type.json +++ b/masking/semantic-type.json @@ -15,7 +15,7 @@ }, { "id": "e8d3fd41-eba0-4afd-ae0f-32c91a4ee710", - "title": "Personal sensitive data x", + "title": "Personal sensitive data", "description": "Custom semantic type with full masking for personal sensitive data", "algorithm": { "fullMask": {