我们有一个预定的github action,有时会失败。如果失败,我如何接收电子邮件通知。目前,只有工作流程的创建者在失败时会收到电子邮件通知。
答案 0 :(得分:0)
你可以在你的行动中试试这个
- name: Send mail
if: always()
uses: dawidd6/action-send-mail@v2
with:
# mail server settings
server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_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: abc@gmail.com,xyz@gmail.com
# from email name
from: XYZ
答案 1 :(得分:0)
具体来说,if: ${{ failure() }}