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
          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://
          from: Github action # <>
          # Optional content type (defaults to text/plain):
          # content_type: text/html
          # Optional attachments:
          # attachments:,git.diff,./dist/static/main.js

My workflow for your reference:


1 Like

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