Skip to content

chore: update masking-3 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
64126f8
test
OP3ratordec Dec 4, 2024
0d8d2c3
Merge pull request #3 from OP3ratordec/test
OP3ratordec Dec 4, 2024
764d4b8
test
OP3ratordec Dec 5, 2024
3dd5f68
Merge pull request #4 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
ba32a48
update
OP3ratordec Dec 5, 2024
6a3e0d4
Merge pull request #5 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
47275c9
test
OP3ratordec Dec 5, 2024
083abbc
Merge pull request #6 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
460e557
test
OP3ratordec Dec 5, 2024
132a433
Merge pull request #7 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
570bdf3
update
OP3ratordec Dec 5, 2024
ca02903
Merge pull request #8 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
52fa5de
test
OP3ratordec Dec 5, 2024
096c600
Merge pull request #9 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
e9a80bc
update
OP3ratordec Dec 5, 2024
153aadf
Merge pull request #10 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
bd3a180
test
OP3ratordec Dec 5, 2024
d415a9d
Merge pull request #11 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
972df44
test
OP3ratordec Dec 5, 2024
368e0c6
Merge pull request #12 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
768a9cb
test
OP3ratordec Dec 5, 2024
3e12533
Merge pull request #13 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
166dca8
test
OP3ratordec Dec 5, 2024
20ecf0d
Merge pull request #14 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
b921885
update
OP3ratordec Dec 5, 2024
167908f
Merge pull request #15 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
1a4f761
test
OP3ratordec Dec 5, 2024
4601e00
Merge pull request #16 from OP3ratordec/o-branch-1
OP3ratordec Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/bb-masking-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ jobs:
CHANGED_FILE="masking/data-classification.json"
echo "Processing: $CHANGED_FILE"

response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification?allow_missing=true" \
response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.data-classification" \
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
--header "Content-Type: application/json" \
--data @"$CHANGED_FILE")

# Extract status code and response body
# Extract status code and response body
status_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')

Expand All @@ -84,13 +84,13 @@ jobs:

- name: Apply global masking rule
id: apply-global-masking-rule
if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, '/global-masking-rule.json') }}
if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, 'global-masking-rule.json') }}
run: |
# Process all global-masking-rule.json files
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "global-masking-rule.json" | while read -r CHANGED_FILE; do
echo "Processing: $CHANGED_FILE"

response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/settings/bb.workspace.global-masking-rule?allow_missing=true" \
response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/policies/masking_rule?allow_missing=true&update_mask=payload" \
--header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
--header "Content-Type: application/json" \
--data @"$CHANGED_FILE")
Expand All @@ -103,11 +103,14 @@ jobs:
echo "Response body: $body"

# Append to outputs (with unique identifiers)
echo "${body}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

if [[ $status_code -lt 200 || $status_code -ge 300 ]]; then
if [[ $status_code -ge 200 && $status_code -lt 300 ]]; then
echo "${body}" >> $GITHUB_OUTPUT
else
echo "Failed with status code: $status_code"
echo "Response body: ${body}"
if [[ $status_code -eq 403 ]]; then
echo "Access denied. Please check your permissions and API token."
fi
exit 1
fi
done
Expand All @@ -119,7 +122,7 @@ jobs:
with:
script: |
const changedFiles = process.env.CHANGED_FILES || '';
let commentBody = `### Masking Policy Update 2 Summary\n\n`;
let commentBody = `### Masking Policy Update 3 Summary\n\n`;

// Add status of merge
commentBody += `✅ **PR Status:** Merged\n\n`;
Expand Down
Loading