Skip to content

Commit 864eeac

Browse files
Merge pull request #78 from bytebase/a-branch-20
update
2 parents 2d10b25 + 529279f commit 864eeac

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

Diff for: .github/workflows/2-bb-masking-column.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
with:
131131
script: |
132132
const changedFiles = process.env.CHANGED_FILES || '';
133-
let commentBody = `### Masking Policy Update Summary\n\n`;
133+
let commentBody = `### Update Column Masking and Exception Summary\n\n`;
134134
135135
// Add status of merge
136136
commentBody += `✅ **PR Status:** Merged\n\n`;

Diff for: .github/workflows/3-bb-masking-classification.yml

+23-28
Original file line numberDiff line numberDiff line change
@@ -88,34 +88,29 @@ jobs:
8888
id: apply-global-masking-rule
8989
if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, 'global-masking-rule-classification.json') }}
9090
run: |
91-
# Process all global-masking-rule-classification.json files
92-
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule-classification.json" | while read -r CHANGED_FILE; do
93-
echo "Processing: $CHANGED_FILE"
94-
95-
response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/policies/masking_rule?allow_missing=true&update_mask=payload" \
96-
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
97-
--header "Content-Type: application/json" \
98-
--data @"$CHANGED_FILE")
99-
100-
# Extract status code and response body
101-
status_code=$(echo "$response" | tail -n1)
102-
body=$(echo "$response" | sed '$d')
103-
104-
echo "Status code: $status_code"
105-
echo "Response body: $body"
106-
107-
# Append to outputs (with unique identifiers)
108-
if [[ $status_code -ge 200 && $status_code -lt 300 ]]; then
109-
echo "${body}" >> $GITHUB_OUTPUT
110-
else
111-
echo "Failed with status code: $status_code"
112-
echo "Response body: ${body}"
113-
if [[ $status_code -eq 403 ]]; then
114-
echo "Access denied. Please check your permissions and API token."
115-
fi
116-
exit 1
117-
fi
118-
done
91+
CHANGED_FILE="masking/global-masking-rule-classification.json"
92+
echo "Processing: $CHANGED_FILE"
93+
94+
response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/policies/masking_rule?allow_missing=true&update_mask=payload" \
95+
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
96+
--data @"$CHANGED_FILE")
97+
98+
# Extract status code and response body
99+
status_code=$(echo "$response" | tail -n1)
100+
body=$(echo "$response" | sed '$d')
101+
102+
echo "status_code=${status_code}" >> $GITHUB_OUTPUT
103+
echo "response_body<<EOF" >> $GITHUB_OUTPUT
104+
echo "${body}" >> $GITHUB_OUTPUT
105+
echo "EOF" >> $GITHUB_OUTPUT
106+
107+
echo "status_code=${status_code}"
108+
echo "response_body=${body}"
109+
110+
if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then
111+
echo "Failed with status code: $status_code"
112+
exit 1
113+
fi
119114
120115
- name: Apply column masking policy
121116
id: apply-column-masking

Diff for: masking/global-masking-rule-classification.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"id": "76356d81-6231-4128-9be7-2c549fc505f5",
99
"condition": {
10-
"expression": "classification_level in [\"2\", \"3\"]",
10+
"expression": "classification_level in [\"2\"]",
1111
"title": "",
1212
"description": ""
1313
},

0 commit comments

Comments
 (0)