簡體   English   中英

github 操作:工作流失敗通知

[英]github actions: notifications on workflow failure

我們有一個計划的github 操作有時會失敗。 如果失敗,我如何接收 email 通知。 目前,只有工作流的創建者在失敗時會收到 email 通知。

我的設置

你可以在你的行動中嘗試這個

- 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM