@@ -63,12 +63,12 @@ jobs:
63
63
CHANGED_FILE="masking/data-classification.json"
64
64
echo "Processing: $CHANGED_FILE"
65
65
66
- response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification?allow_missing=true " \
66
+ response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification" \
67
67
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
68
68
--header "Content-Type: application/json" \
69
69
--data @"$CHANGED_FILE")
70
70
71
- # Extract status code and response body
71
+ # Extract status code and response body
72
72
status_code=$(echo "$response" | tail -n1)
73
73
body=$(echo "$response" | sed '$d')
74
74
@@ -84,13 +84,13 @@ jobs:
84
84
85
85
- name : Apply global masking rule
86
86
id : apply-global-masking-rule
87
- if : ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, '/ global-masking-rule.json') }}
87
+ if : ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, 'global-masking-rule.json') }}
88
88
run : |
89
89
# Process all global-masking-rule.json files
90
90
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule.json" | while read -r CHANGED_FILE; do
91
91
echo "Processing: $CHANGED_FILE"
92
92
93
- response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.global-masking-rule ?allow_missing=true" \
93
+ response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/policies/masking_rule ?allow_missing=true&update_mask=payload " \
94
94
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
95
95
--header "Content-Type: application/json" \
96
96
--data @"$CHANGED_FILE")
@@ -103,11 +103,14 @@ jobs:
103
103
echo "Response body: $body"
104
104
105
105
# Append to outputs (with unique identifiers)
106
- echo "${body}" >> $GITHUB_OUTPUT
107
- echo "EOF" >> $GITHUB_OUTPUT
108
-
109
- if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then
106
+ if [[ $status_code -ge 200 && $status_code -lt 300 ]]; then
107
+ echo "${body}" >> $GITHUB_OUTPUT
108
+ else
110
109
echo "Failed with status code: $status_code"
110
+ echo "Response body: ${body}"
111
+ if [[ $status_code -eq 403 ]]; then
112
+ echo "Access denied. Please check your permissions and API token."
113
+ fi
111
114
exit 1
112
115
fi
113
116
done
@@ -119,7 +122,7 @@ jobs:
119
122
with :
120
123
script : |
121
124
const changedFiles = process.env.CHANGED_FILES || '';
122
- let commentBody = `### Masking Policy Update 2 Summary\n\n`;
125
+ let commentBody = `### Masking Policy Update 3 Summary\n\n`;
123
126
124
127
// Add status of merge
125
128
commentBody += `✅ **PR Status:** Merged\n\n`;
0 commit comments