-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from all commits
8129c77
4f14b29
d15d95c
a3e2d66
4f0cb7a
7ecc313
c856842
7b1abce
bc2269c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()) | ||
uses: dawidd6/action-send-mail@v2 | ||
with: | ||
# mail server settings | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
# user credentials | ||
username: ${{ secrets.NOTIFY_EMAIL }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
password: ${{ secrets.NOTIFY_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] | ||
# from email name | ||
from: Dr Manhattan |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,23 @@ jobs: | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
twine upload dist/* | ||
- name: Send mail | ||
# Notify when cron job fails | ||
if: failure() | ||
uses: dawidd6/action-send-mail@v2 | ||
with: | ||
# mail server settings | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
# user credentials | ||
username: ${{ secrets.NOTIFY_EMAIL }} | ||
password: ${{ secrets.NOTIFY_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] | ||
# from email name | ||
from: Dr Manhattan |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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