Skip to content

Commit

Permalink
ChangedGithubActions
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayp7 committed Feb 24, 2024
1 parent 46dbf85 commit e8206a6
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,40 @@ jobs:
# This step should always run, even if previous steps fail
if: always()

# Step to send email with the zip report
# Step to send email with the zip report using SendGrid API
- name: Send email with zip report
run: |
echo "Sending email with zip report"
echo "This is the body of the email" | mutt -s "Subject: Playwright Test Report" -a html-report.zip codendeavor@gmail.com
curl -X "POST" "https://api.sendgrid.com/v3/mail/send" \
-H 'Authorization: Bearer YOUR_SENDGRID_API_KEY' \
-H 'Content-Type: application/json' \
-d $'{
"personalizations": [
{
"to": [
{
"email": "recipient@example.com"
}
],
"subject": "Playwright Test Report"
}
],
"from": {
"email": "sender@example.com"
},
"content": [
{
"type": "text/plain",
"value": "This is the body of the email."
}
],
"attachments": [
{
"content": "'"$(base64 html-report.zip)"'",
"filename": "html-report.zip",
"type": "application/zip",
"disposition": "attachment"
}
]
}'
# This step should only run if the previous steps were successful
if: success()

0 comments on commit e8206a6

Please sign in to comment.