【发布时间】:2022-10-21 20:16:17
【问题描述】:
我已经配置了 github Action 来自动化应用部署。我现在正在尝试的是使用 AWS SES 获取有关操作失败的电子邮件通知。我用过发邮件链接中给出的功能。
1. https://github.com/marketplace/actions/send-email
这是我的代码
- name: Send mail
if: always()
uses: dawidd6/action-send-mail@v3
with:
# mail server settings
server_address: ${{secrets.SMTP_HOST}}
server_port: 465
# Optional (recommended): mail server username:
username: ${{secrets.SMTP_USERNAME}}
# Optional (recommended) mail server password:
password: ${{secrets.SMTP_PASSWORD}}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: xyz@example.com
# from email name
from: 'abc@example.com'
笔记:
- 我的域 example.com 已在 SES 中验证
- 我的往返地址已在 SES 中验证
- 我不在沙盒模式
我得到的错误
with: server_address: *** server_port: 465 username: *** password: *** subject: job1 job of ***/pv-core has success body: job1 job in worflow TestCI of ***/pv-core has success to: xyz@***.com from: *** "abc@***.com"错误:邮件命令失败:501 提供的 MAIL FROM 地址无效
预期产出
需要提醒 xyz@example.com(其别名电子邮件将发送给 5 名成员的团队) 每当动作失败
【问题讨论】:
标签: amazon-web-services github amazon-ses cicd