Skip to content

Commit

Permalink
Merge pull request #1 from Roopan-Microsoft/patch-2
Browse files Browse the repository at this point in the history
Update RAdeploy.yml
  • Loading branch information
Prashant-Microsoft authored Sep 25, 2024
2 parents 265e9a2 + 60f7bcb commit d8481ca
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/RAdeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ jobs:
- name: Send Notification on Failure
if: failure()
run: |
echo "GitHub Context:" echo "${{ toJson(github) }}"
output="${{ env.output }}"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "$output"
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
# Construct the full run URL
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Construct the email body as a simple JSON object
EMAIL_BODY=$(cat <<EOF
{
"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"
}
EOF
)
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
-H "Content-Type: application/json" \
-d "{\"failureMessage\": \"Workflow failed!\", \"runLink\": \"${{ github.run_url }}\"}"
-d "{\"failureMessage\": $EMAIL_BODY}\"} || echo "Failed to send notification"

0 comments on commit d8481ca

Please sign in to comment.