|
1 | | -name: Send Notification Job |
| 1 | +name: Send Notification Job |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_call: |
@@ -105,6 +105,9 @@ jobs: |
105 | 105 | CLEANUP_PILL: ${{ steps.cleanup.outputs.CLEANUP_PILL }} |
106 | 106 | CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} |
107 | 107 | run: | |
| 108 | + html_escape() { |
| 109 | + printf '%s' "$1" | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g' -e 's/"/\"/g' -e "s/'/\'/g" |
| 110 | + } |
108 | 111 | RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" |
109 | 112 | 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;" |
110 | 113 | DEPLOY_PILL="<span style=\"${PILL_BASE} background:#f8d7da; color:#721c24;\">❌ FAILED</span>" |
@@ -178,8 +181,13 @@ jobs: |
178 | 181 | CONFIG_LABEL: ${{ steps.config.outputs.CONFIG_LABEL }} |
179 | 182 | CLEANUP_PILL: ${{ steps.cleanup.outputs.CLEANUP_PILL }} |
180 | 183 | run: | |
| 184 | + html_escape() { |
| 185 | + printf '%s' "$1" | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g' -e 's/"/\"/g' -e "s/'/\'/g" |
| 186 | + } |
181 | 187 | 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 }}")" |
183 | 191 | 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;" |
184 | 192 | DEPLOY_PILL="<span style=\"${PILL_BASE} background:#f8d7da; color:#721c24;\">❌ FAILED</span>" |
185 | 193 |
|
@@ -213,9 +221,9 @@ jobs: |
213 | 221 | <tr><td style="padding:8px 0; font-size:13px; color:#6b7280; width:140px;">Resource Group</td> |
214 | 222 | <td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${RESOURCE_GROUP}</td></tr> |
215 | 223 | <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> |
217 | 225 | <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> |
219 | 227 | </table> |
220 | 228 | <table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="padding:8px 0;"> |
221 | 229 | <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: |
263 | 271 | RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" |
264 | 272 | WEBAPP_URL="$(html_escape "${INPUT_WEB_APPURL:-$INPUT_EXISTING_WEBAPP_URL}")" |
265 | 273 | RESOURCE_GROUP="$(html_escape "$INPUT_RESOURCE_GROUP_NAME")" |
| 274 | + ACTOR="$(html_escape "${{ github.actor }}")" |
| 275 | + BRANCH="$(html_escape "${{ env.BRANCH_NAME }}")" |
266 | 276 | 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;" |
267 | 277 | DEPLOY_PILL="<span style=\"${PILL_BASE} background:#d4edda; color:#155724;\">✅ SUCCESS</span>" |
268 | 278 |
|
@@ -295,9 +305,9 @@ jobs: |
295 | 305 | <tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Web App URL</td> |
296 | 306 | <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> |
297 | 307 | <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> |
299 | 309 | <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> |
301 | 311 | </table> |
302 | 312 | <table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td align="center" style="padding:8px 0;"> |
303 | 313 | <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