-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 will not be sent without any failure #8665
Email will not be sent without any failure #8665
Conversation
@VaibhavMalik4187 Let's discuss this on Meshery Dev call. Please add this as an agenda item in the meeting minutes if you would. :) |
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.
if: ${{ always() }} |
I think the problem is here the condition should be something like this
if: ${ always() && (needs.update-grapql-docs.result == 'failure' || needs.update-swagger-docs.result=='failure'and so on for other jobs) }
This is yet another way to check if we should start the job or not. However, this looks very tedious, especially for workflows having multiple jobs.
|
Okay i got you now we can do that but if there are no jobs failed then why do we need to run email-on-failure we can stop it the start itself |
Your approach suggests checking for failed jobs by hard coding the values and then comparing the result of each job with "failure". This violates the DRY principle. It is also prone to error. Suppose, later, at some point, 5 more jobs are added in this workflow. The comparisons would keep on growing. That's why I'm using the REST API to determine the failed jobs without hardcoding any values. And just as you suggested, I'm also skipping the |
Yes you are right that was just a suggestion what i meant was to check if there was a failure in any of the previously runned job then only email-on-failure job should run we can also try |
6aa91f3
to
33ad3b4
Compare
Removed extra string: `EMAIL_BODY=` from the environment variable EMAIL_BODY. Fixes: meshery#8664 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
33ad3b4
to
6f107e8
Compare
Great suggestion, I've changed the code accordingly. |
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.
LGTM 👌
Removed extra string:
EMAIL_BODY=
from the environment variable EMAIL_BODY.Fixes: #8664
Signed commits