How to control notifications for cron triggered workflows?

How can I specify a list of users that get notified when a cron triggered workflow fails?
Right now it appears that whichever user last pushed the codebase is the one and only user that gets notified.

Hi @pcstout,

This is by designed. As a workaround, you can add a step to send out the notification to a list of users.
You can find a lot of ‘send email’ actions in the marketpace.
For example, you can use:

      - name: failed step
        run: |
          exit 1
      - name: Send mail
        if: failure()
        uses: dawidd6/action-send-mail@v2
        with:
          server_address: smtp.gmail.com
          server_port: 465
          username: ${{secrets.MAIL_USERNAME}}
          password: ${{secrets.MAIL_PASSWORD}}
          subject: Github Actions job result
          # Literal body:
          body: Build job of ${{github.repository}} Failed!
          # Read file contents as body:
          # body: file://README.md
          to: wexxxxx@outlook.com,zxdxxxx5@outlook.com
          from: Github action # <user@example.com>
          # Optional content type (defaults to text/plain):
          # content_type: text/html
          # Optional attachments:
          # attachments: attachments.zip,git.diff,./dist/static/main.js

My workflow for your reference: https://github.com/weide-zhou/ticket13/runs/764453779?check_suite_focus=true#step:3:29

Thanks

1 Like

Thank @weide-zhou! This is exactly what I needed. Works perfectly.