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

Fix #23725: Actions - send Email on Success/Failure #33601

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Mayank77maruti
Copy link

@Mayank77maruti Mayank77maruti commented Feb 14, 2025

Fixes #23725
/claim #23725

Signed-off-by: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 14, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Feb 14, 2025
Signed-off-by: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com>
Signed-off-by: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com>
Signed-off-by: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com>
@lunny
Copy link
Member

lunny commented Feb 14, 2025

Maybe we should use #30278

@Mayank77maruti
Copy link
Author

Mayank77maruti commented Feb 23, 2025

@lunny can you please take a look.
If I am going in the correct direction.

@jonnytest1
Copy link

i think we should go the event route 🤔 under https://gitea/user/settings/hooks/gitea/new u can specify a list of events for which a webhook is triggered - i think including it there would be the right step - maybe extend the event system with "should send email by default" or something like it, which should then be sub/unsubscibable in user settings

@lunny
Copy link
Member

lunny commented Mar 1, 2025

I think #33694 will replace this one. Or this one should depend on #33694 .

@ChristopherHX
Copy link
Contributor

I want to clarify #33694 is workflow_job tied to starting / finishing of jobs not workflows.

You cannot implement this by listening for independent job completion.

The email should afaik depend on workflow_run (completed) webhook / notifier, which I initially planned to do as well.
That would however require this notifier added here to also trigger for workflow started, but skip the email in this case.

@jonnytest1
Copy link

i think it would be a good idea to implement this email listening as centrally as possible - i.e. listen to all events and (maybe hardcoded for now) only send email on that one example , then its easier to make it user customizable in the future, no ?

@ChristopherHX
Copy link
Contributor

to implement this email listening as centrally as possible

Yes adding a webhook category for Email, then allow a text fields to provide golang templates to generate the subject, body + a custom filter expression (based on webhook json fields) would technically be a really powerfull and customizable feature for keep up to date. (Bad User Experience, good Developer Experience)

Then provide a preconfigured list for each webhook to choose the Email style for the event. (Better User Experience)

Would then depend on a webhook for workflow completion to be added.

I'm only active in this PR thread, because my PR has been referenced here. I don't even have EMail set up in my instance so I will be silent here

@jonnytest1
Copy link

i was more thinking a central event pipeline that then feeds into webhook and email seperately 🤔 it would allow to configure email obver webhook tho ^^ (which might also be a neat first workaround so the current issue doenst blow the scope up too much )

@jonnytest1
Copy link

jonnytest1 commented Mar 2, 2025

apparently action events are part of this :
image

if u run a workflow like this:

image

got me this:

image

(its not really detailed enough for a perfect status email (since the step isnt in it) , but for everyone looking for a quick workaround settings up a mini server that waits for this webhook and then sends an email might be a decent alternative)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Actions - send Email on Success/Failure
5 participants