Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email notifications on failure #350

Open
tbantle22 opened this issue Feb 2, 2022 · 0 comments
Open

Email notifications on failure #350

tbantle22 opened this issue Feb 2, 2022 · 0 comments
Assignees

Comments

@tbantle22
Copy link
Collaborator

It looks like github actions only send failure notifications to the person who started the workflow or the person who created the worflow yaml file.

Looks like we can configure sending emails on failure like this:
https://www.ravsam.in/blog/send-email-notification-when-github-action-fails/

So that it will look something like:

- name: Send mail
  if: always()
  uses: dawidd6/action-send-mail@v2
  with:
    status: ${{ job.status }} # required
    notify_when: 'failure'
    # 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: [email protected],[email protected]
    # from email name
    from: John Doe
@tbantle22 tbantle22 self-assigned this Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant