Skip to content

Commit 8208fe3

Browse files
Merge pull request #258 from microsoft/psl-fixcopilotcomments-cm-vs
fix: fixed copilot comments
2 parents cbc17d0 + 671f3ee commit 8208fe3

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/job-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ jobs:
202202
if [[ "$ENABLE_SCALABILITY_VALUE" != "true" && "$ENABLE_SCALABILITY_VALUE" != "false" ]]; then
203203
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY_VALUE'"
204204
VALIDATION_FAILED=true
205+
elif [[ "$ENABLE_SCALABILITY_VALUE" == "true" && "$INPUT_WAF_ENABLED" != "true" ]]; then
206+
echo "❌ ERROR: enable_scalability can only be enabled when waf_enabled is 'true'"
207+
VALIDATION_FAILED=true
205208
else
206209
echo "✅ enable_scalability: '$ENABLE_SCALABILITY_VALUE' is valid"
207210
fi

.github/workflows/job-send-notification.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Send Notification Job
1+
name: Send Notification Job
22

33
on:
44
workflow_call:
@@ -105,6 +105,9 @@ jobs:
105105
CLEANUP_PILL: ${{ steps.cleanup.outputs.CLEANUP_PILL }}
106106
CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }}
107107
run: |
108+
html_escape() {
109+
printf '%s' "$1" | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\&#39;/g"
110+
}
108111
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
109112
PILL_BASE="display:inline-block; min-width:70px; text-align:center; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:600; line-height:1.4;"
110113
DEPLOY_PILL="<span style=\"${PILL_BASE} background:#f8d7da; color:#721c24;\">&#x274C; FAILED</span>"
@@ -178,8 +181,13 @@ jobs:
178181
CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }}
179182
CLEANUP_PILL: ${{ steps.cleanup.outputs.CLEANUP_PILL }}
180183
run: |
184+
html_escape() {
185+
printf '%s' "$1" | sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\&#39;/g"
186+
}
181187
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
182-
RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME"
188+
RESOURCE_GROUP="$(html_escape "$INPUT_RESOURCE_GROUP_NAME")"
189+
ACTOR="$(html_escape "${{ github.actor }}")"
190+
BRANCH="$(html_escape "${{ env.BRANCH_NAME }}")"
183191
PILL_BASE="display:inline-block; min-width:70px; text-align:center; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:600; line-height:1.4;"
184192
DEPLOY_PILL="<span style=\"${PILL_BASE} background:#f8d7da; color:#721c24;\">&#x274C; FAILED</span>"
185193
@@ -213,9 +221,9 @@ jobs:
213221
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280; width:140px;">Resource Group</td>
214222
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${RESOURCE_GROUP}</td></tr>
215223
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Triggered By</td>
216-
<td style="padding:8px 0; font-size:13px; color:#111827;">${{ github.actor }}</td></tr>
224+
<td style="padding:8px 0; font-size:13px; color:#111827;">${ACTOR}</td></tr>
217225
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Branch</td>
218-
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${{ env.BRANCH_NAME }}</td></tr>
226+
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${BRANCH}</td></tr>
219227
</table>
220228
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="padding:8px 0;">
221229
<a href="${RUN_URL}" style="display:inline-block; background:#dc2626; color:#ffffff; text-decoration:none; padding:12px 28px; border-radius:4px; font-size:13px; font-weight:600; letter-spacing:0.3px;">INVESTIGATE FAILURE</a>
@@ -263,6 +271,8 @@ jobs:
263271
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
264272
WEBAPP_URL="$(html_escape "${INPUT_WEB_APPURL:-$INPUT_EXISTING_WEBAPP_URL}")"
265273
RESOURCE_GROUP="$(html_escape "$INPUT_RESOURCE_GROUP_NAME")"
274+
ACTOR="$(html_escape "${{ github.actor }}")"
275+
BRANCH="$(html_escape "${{ env.BRANCH_NAME }}")"
266276
PILL_BASE="display:inline-block; min-width:70px; text-align:center; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:600; line-height:1.4;"
267277
DEPLOY_PILL="<span style=\"${PILL_BASE} background:#d4edda; color:#155724;\">&#x2705; SUCCESS</span>"
268278
@@ -295,9 +305,9 @@ jobs:
295305
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Web App URL</td>
296306
<td style="padding:8px 0; font-size:13px;"><a href="${WEBAPP_URL}" style="color:#2563eb; text-decoration:none; font-family:'Cascadia Code','Courier New',monospace;">${WEBAPP_URL}</a></td></tr>
297307
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Triggered By</td>
298-
<td style="padding:8px 0; font-size:13px; color:#111827;">${{ github.actor }}</td></tr>
308+
<td style="padding:8px 0; font-size:13px; color:#111827;">${ACTOR}</td></tr>
299309
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Branch</td>
300-
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${{ env.BRANCH_NAME }}</td></tr>
310+
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${BRANCH}</td></tr>
301311
</table>
302312
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="padding:8px 0;">
303313
<a href="${RUN_URL}" style="display:inline-block; background:#111827; color:#ffffff; text-decoration:none; padding:12px 28px; border-radius:4px; font-size:13px; font-weight:600; letter-spacing:0.3px;">VIEW PIPELINE RUN</a>

0 commit comments

Comments
 (0)