Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 2.59 KB

README.md

File metadata and controls

62 lines (42 loc) · 2.59 KB

E-mail Release Notification

This repo contains a re-usable GitHub Action that when installed sends an e-mail to a distribution list with the release notes every time a GitHub Release is created for the repository.

This Action makes use of SendGrid's API to send the e-mails.

Pre-Requisites

To run this action you'll need:

Setup

1. Create the workflow

Add a new YML file workflow in .github/workflows to trigger on release. For example:

name: E-Mail Release Notification
on:
  release:
    types: [published]
jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
    - name: Notify about a new release
      uses: ba-st-actions/[email protected]
      env:
        SENDGRID_API_TOKEN: ${{ secrets.SENDGRID_API_TOKEN }}
        RECIPIENTS_URL: ${{ secrets.RECIPIENTS_URL }}
        SENDER_EMAIL: ${{ secrets.SENDER_EMAIL }}
        DISTRIBUTION_LISTS: ${{ secrets.DISTRIBUTION_LISTS }}

2. Set the SendGrid secret

Create a new secret on your project named SENDGRID_API_TOKEN. Set the value to your SendGrid API Key.

3. Set the RECIPIENTS_URL secret

Do the same for a secret named RECIPIENTS_URL that you need to set to the URI of the text file with the target recipients. The contents of the file should be a list of e-mails separated by newlines, for example:

If you don't know where to host this file, just go to GitHub Gists and create a new textfile with the e-mails you want to target. After you save the file just click raw and get the URI of the file you've just created.

4. Set the DISTRIBUTION_LISTS secret (Optional)

Do the same for a secret named DISTRIBUTION_LISTS. The secret contents is a comma separated list of e-mails for other lists (This e-mails will be put in CC in the outgoing mail).

5. Set the SENDER_EMAIL secret

Do the same for a secret named SENDER_EMAIL including the e-mail to be used in the from: field on the mail message.

6. Test the workflow!

Create a new release for your repository and verify that the action triggers and that the e-mails were sent. Sometimes it's worth checking the spam inbox.