File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,10 +106,17 @@ jobs:
106106 id : apply-global-masking-rule
107107 if : ${{ steps.changed-files.outputs.any_changed == 'true' && contains(steps.changed-files.outputs.all_changed_files, 'global-masking-rule.json') }}
108108 run : |
109- CHANGED_FILE="masking/global-masking-rule.json"
109+ CHANGED_FILE="masking/global-masking-rule.json"
110110 echo "Processing: $CHANGED_FILE"
111-
112- response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/workspaces/-/policies/masking_rule?allowMissing=true&updateMask=payload" \
111+
112+ # Resolve the current workspace resource name. Policy URLs need the
113+ # real workspace ID — "workspaces/-" only works for GetWorkspace.
114+ WORKSPACE_NAME=$(curl -s \
115+ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
116+ "${{ steps.bytebase-login.outputs.api_url }}/workspaces/-" | jq -r '.name')
117+ echo "Workspace: $WORKSPACE_NAME"
118+
119+ response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/${WORKSPACE_NAME}/policies/masking_rule?allowMissing=true&updateMask=payload" \
113120 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
114121 --header "Content-Type: application/json" \
115122 --data @"$CHANGED_FILE")
Original file line number Diff line number Diff line change @@ -88,10 +88,17 @@ 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- CHANGED_FILE="masking/global-masking-rule-classification.json"
91+ CHANGED_FILE="masking/global-masking-rule-classification.json"
9292 echo "Processing: $CHANGED_FILE"
93-
94- response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/workspaces/-/policies/masking_rule?allowMissing=true&updateMask=payload" \
93+
94+ # Resolve the current workspace resource name. Policy URLs need the
95+ # real workspace ID — "workspaces/-" only works for GetWorkspace.
96+ WORKSPACE_NAME=$(curl -s \
97+ --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
98+ "${{ steps.bytebase-login.outputs.api_url }}/workspaces/-" | jq -r '.name')
99+ echo "Workspace: $WORKSPACE_NAME"
100+
101+ response=$(curl -s -w "\n%{http_code}" --request PATCH "${{ steps.bytebase-login.outputs.api_url }}/${WORKSPACE_NAME}/policies/masking_rule?allowMissing=true&updateMask=payload" \
95102 --header "Authorization: Bearer ${{ steps.bytebase-login.outputs.token }}" \
96103 --header "Content-Type: application/json" \
97104 --data @"$CHANGED_FILE")
You can’t perform that action at this time.
0 commit comments