Send emails with GitHub Actions

Published:
Talks about: , , and

The dawidd6/action-send-mail action allows to send an email in your GitHub Action.

name: <PIPELINE>
jobs:
  build:
    runs-on: <RUN_ON>
    steps:
      - name: Send mail
        uses: dawidd6/action-send-mail@v2
        with:
          server_address: ${{ secrets.MAIL_SERVER }}
          server_port: ${{ secrets.MAIL_PORT }}
          username: ${{ secrets.MAIL_USERNAME }}
          password: ${{ secrets.MAIL_PASSWORD }}
          subject: <SUBJECT>
          body: <BODY>
          to: ${{ secrets.MAIL_RECIPIENT }}
          from: ${{ secrets.MAIL_SENDER }}

Create appropriate secrets in your organization or project. In case you are using an organization, but different mailing lists, define MAIL_RECIPIENT for each project.