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

Mic 4383/4384/notify if actions fail #334

Merged
merged 9 commits into from
Oct 23, 2023
Merged

Conversation

albrja
Copy link
Contributor

@albrja albrja commented Oct 19, 2023

Mic-4383/4484/notify if actions fail

Sends email notification on actions failures

-Adds functionality to send notifications via email when a cron or deploy workflow actions fails.

Testing

-Made new email to use to send notifications through action
-Recei

@@ -50,3 +50,22 @@ jobs:
- name: Doctest
run: |
make doctest -C docs/
- name: Send mail
# Notify when cron job fails
if: (github.event_name == 'schedule' && failure())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its weird I can't check failure by job.status == 'failure'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a more pointed question if anyone knows is I don't understand when I have to use something like ${{ github.job }} instead of just github.event_name

server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.NOTIFY_EMAIL }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've currently created a new gmail account [email protected] that sends the email.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I would need to regenerate the password since I didn't save it and would need to do this for all repositories we want it in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussions today, I will update the secrets email to be the vivarium dev email when we want to implement this in all repositories as that will be a sweeping change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you update the email to [email protected]? If not, I think you should do that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I have - this currently won't work because I will need to set up the secrets password with the the app password in that email account through gmail.

# 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]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need to be replaced with vivarium-dev email and then forward the email to all code owners or we would need to comma separate all code owners emails here.

server_address: smtp.gmail.com
server_port: 465
# user credentials
username: ${{ secrets.NOTIFY_EMAIL }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you update the email to [email protected]? If not, I think you should do that now.

body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed this email address change.

@albrja albrja merged commit d4d582f into main Oct 23, 2023
@albrja albrja deleted the mic-4384/notify-cron-fail branch October 23, 2023 22:45
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

Successfully merging this pull request may close these issues.

2 participants