|
1 | | -name: Bytebase Masking Policy Update Column and Exception |
| 1 | +name: Bytebase Masking Policy Update Column and Exemption |
2 | 2 | on: |
3 | 3 | pull_request: |
4 | 4 | types: [closed] |
|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - bytebase-masking-column-and-exception: |
| 10 | + bytebase-masking-column-and-exemption: |
11 | 11 | if: github.event.pull_request.merged == true |
12 | 12 | runs-on: ubuntu-latest |
13 | 13 | permissions: |
|
35 | 35 | with: |
36 | 36 | files: | |
37 | 37 | masking/databases/**/**/database-catalog.json |
38 | | - masking/projects/**/masking-exception.json |
| 38 | + masking/projects/**/masking-exemption.json |
39 | 39 | since_last_remote_commit: true |
40 | 40 | fetch_depth: 0 |
41 | 41 | include_all_old_new_renamed_files: true |
|
49 | 49 | echo "Modified files:" |
50 | 50 | echo "${{ steps.changed-files.outputs.modified_files }}" |
51 | 51 | echo "Contains database-catalog.json: ${{ contains(steps.changed-files.outputs.all_changed_files, 'database-catalog.json') }}" |
52 | | - echo "Contains masking-exception.json: ${{ contains(steps.changed-files.outputs.all_changed_files, 'masking-exception.json') }}" |
| 52 | + echo "Contains masking-exemption.json: ${{ contains(steps.changed-files.outputs.all_changed_files, 'masking-exemption.json') }}" |
53 | 53 | echo "Raw output:" |
54 | 54 | echo "${{ toJSON(steps.changed-files.outputs) }}" |
55 | 55 |
|
@@ -89,17 +89,17 @@ jobs: |
89 | 89 | fi |
90 | 90 | done |
91 | 91 |
|
92 | | - - name: Apply masking exception policy |
93 | | - id: apply-masking-exception |
94 | | - if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, '/masking-exception.json') }} |
| 92 | + - name: Apply masking exemption policy |
| 93 | + id: apply-masking-exemption |
| 94 | + if: ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, '/masking-exemption.json') }} |
95 | 95 | run: | |
96 | | - # Process all masking-exception.json files |
97 | | - echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "masking-exception.json" | while read -r CHANGED_FILE; do |
| 96 | + # Process all masking-exemption.json files |
| 97 | + echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep "masking-exemption.json" | while read -r CHANGED_FILE; do |
98 | 98 | echo "Processing: $CHANGED_FILE" |
99 | 99 | PROJECT_NAME=$(echo "$CHANGED_FILE" | sed -n 's/masking\/projects\/\([^/]*\).*/\1/p') |
100 | 100 | echo "PROJECT_NAME=$PROJECT_NAME" |
101 | 101 | |
102 | | - response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/projects/${PROJECT_NAME}/policies/masking_exception?allow_missing=true&update_mask=payload" \ |
| 102 | + response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/projects/${PROJECT_NAME}/policies/masking_exemption?allowMissing=true&updateMask=payload" \ |
103 | 103 | --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \ |
104 | 104 | --header "Content-Type: application/json" \ |
105 | 105 | --data @"$CHANGED_FILE") |
@@ -130,7 +130,7 @@ jobs: |
130 | 130 | with: |
131 | 131 | script: | |
132 | 132 | const changedFiles = process.env.CHANGED_FILES || ''; |
133 | | - let commentBody = `### Update Column Masking and Exception Summary\n\n`; |
| 133 | + let commentBody = `### Update Column Masking and Exemption Summary\n\n`; |
134 | 134 | |
135 | 135 | // Add status of merge |
136 | 136 | commentBody += `✅ **PR Status:** Merged\n\n`; |
@@ -163,18 +163,18 @@ jobs: |
163 | 163 | }); |
164 | 164 | } |
165 | 165 |
|
166 | | - if (changedFiles.includes('masking-exception.json')) { |
167 | | - const exceptionStatuses = Object.keys(${{ toJSON(steps.apply-masking-exception.outputs) }} || {}) |
| 166 | + if (changedFiles.includes('masking-exemption.json')) { |
| 167 | + const exceptionStatuses = Object.keys(${{ toJSON(steps.apply-masking-exemption.outputs) }} || {}) |
168 | 168 | .filter(key => key.startsWith('status_code_')) |
169 | 169 | .map(key => ({ |
170 | 170 | name: key.replace('status_code_', ''), |
171 | | - status: ${{ toJSON(steps.apply-masking-exception.outputs) }}[key] |
| 171 | + status: ${{ toJSON(steps.apply-masking-exemption.outputs) }}[key] |
172 | 172 | })); |
173 | 173 | |
174 | 174 | exceptionStatuses.forEach(({name, status}) => { |
175 | 175 | apiCallsFound = true; |
176 | 176 | const success = status >= 200 && status < 300; |
177 | | - commentBody += `- Masking Exception (${name}): ${success ? '✅' : '❌'} ${status}\n`; |
| 177 | + commentBody += `- Masking Exemption (${name}): ${success ? '✅' : '❌'} ${status}\n`; |
178 | 178 | }); |
179 | 179 | } |
180 | 180 |
|
|
0 commit comments