Skip to content

Commit d764d52

Browse files
Refactor cleanup-deployment conditions and update notification email content for clarity
1 parent 2a6b283 commit d764d52

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/deploy-orchestrator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
secrets: inherit
122122

123123
cleanup-deployment:
124-
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
124+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
125125
needs: [docker-build, deploy, e2e-test]
126126
uses: ./.github/workflows/job-cleanup-deployment.yml
127127
with:

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,15 @@ jobs:
401401
402402
EMAIL_BODY=$(cat <<EOF
403403
{
404-
"body": "<p>Dear Team,</p><p>The ${ACCELERATOR_NAME} pipeline executed against the <strong>existing WebApp URL</strong> and testing process has completed successfully.</p><p><strong>Test Results:</strong><br>• Status: ✅ Passed<br>• Test Suite: ${TEST_SUITE_NAME}<br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a></p><p><strong>Deployment:</strong> Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
405-
"subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Passed (Existing URL)"
404+
"body": "<p>Dear Team,</p><p>The ${ACCELERATOR_NAME} pipeline executed against the <strong>Specified WebApp URL</strong> and testing process has completed successfully.</p><p><strong>Test Results:</strong><br>• Status: ✅ Passed<br>• Test Suite: ${TEST_SUITE_NAME}<br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a></p><p><strong>Deployment:</strong> Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
405+
"subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Passed"
406406
}
407407
EOF
408408
)
409409
410410
curl -X POST "${LOGICAPP_URL}" \
411411
-H "Content-Type: application/json" \
412-
-d "$EMAIL_BODY" || echo "Failed to send existing URL success notification"
412+
-d "$EMAIL_BODY" || echo "Failed to send success notification"
413413
414414
- name: Send Existing URL Test Failure Notification
415415
if: inputs.deploy_result == 'skipped' && inputs.existing_webapp_url != '' && inputs.e2e_test_result == 'failure'
@@ -430,12 +430,12 @@ jobs:
430430
431431
EMAIL_BODY=$(cat <<EOF
432432
{
433-
"body": "<p>Dear Team,</p><p>The ${ACCELERATOR_NAME} pipeline executed against the <strong>existing WebApp URL</strong> and the test automation has encountered issues and failed to complete successfully.</p><p><strong>Failure Details:</strong><br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a><br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Test Suite: ${TEST_SUITE_NAME}<br>• Deployment: Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
434-
"subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Failed (Existing URL)"
433+
"body": "<p>Dear Team,</p><p>The ${ACCELERATOR_NAME} pipeline executed against the <strong>Specified WebApp URL</strong> and the test automation has encountered issues and failed to complete successfully.</p><p><strong>Failure Details:</strong><br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a><br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Test Suite: ${TEST_SUITE_NAME}<br>• Deployment: Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
434+
"subject": "${ACCELERATOR_NAME} Pipeline - Test Automation Failed"
435435
}
436436
EOF
437437
)
438438
439439
curl -X POST "${LOGICAPP_URL}" \
440440
-H "Content-Type: application/json" \
441-
-d "$EMAIL_BODY" || echo "Failed to send existing URL test failure notification"
441+
-d "$EMAIL_BODY" || echo "Failed to send test failure notification"

0 commit comments

Comments
 (0)