Skip to content

Commit d8481ca

Browse files
Merge pull request #1 from Roopan-Microsoft/patch-2
Update RAdeploy.yml
2 parents 265e9a2 + 60f7bcb commit d8481ca

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/RAdeploy.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,16 @@ jobs:
7272
- name: Send Notification on Failure
7373
if: failure()
7474
run: |
75-
echo "GitHub Context:" echo "${{ toJson(github) }}"
76-
output="${{ env.output }}"
77-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
78-
echo "$output"
79-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
80-
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
75+
# Construct the full run URL
76+
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
77+
78+
# Construct the email body as a simple JSON object
79+
EMAIL_BODY=$(cat <<EOF
80+
{
81+
"body": "Dear Team,\\n\\nWe would like to inform you that the CWYD Automation process has encountered an issue and has failed to complete successfully.\\n\\n**Run ID:** ${GITHUB_RUN_ID}\\n**Failure Message:** ${OUTPUT}\\n\\nPlease investigate the matter at your earliest convenience.\\n\\nBest regards,\\nYour Automation Team"
82+
}
83+
EOF
84+
)
85+
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
8186
-H "Content-Type: application/json" \
82-
-d "{\"failureMessage\": \"Workflow failed!\", \"runLink\": \"${{ github.run_url }}\"}"
87+
-d "{\"failureMessage\": $EMAIL_BODY}\"} || echo "Failed to send notification"

0 commit comments

Comments
 (0)