Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Send email on Workflow Run Success/Failure#34982

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lunny merged 46 commits intogo-gitea:mainfromNorthRealm:patch4
Jul 16, 2025
Merged

Send email on Workflow Run Success/Failure#34982

lunny merged 46 commits intogo-gitea:mainfromNorthRealm:patch4
Jul 16, 2025

Conversation

@NorthRealm
Copy link
Contributor

@NorthRealmNorthRealm commentedJul 7, 2025
edited
Loading

Closes#23725

1
2

/claim#23725

silverwind, ankurk91, lunny, wxiaoguang, Naxdy, a1012112796, deadnews, ChristopherHX, and Felitendo reacted with thumbs up emoji
@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelJul 7, 2025
@github-actionsgithub-actionsbot added modifies/goPull requests that update Go code modifies/templatesThis PR modifies the template files labelsJul 7, 2025
@NorthRealm
Copy link
ContributorAuthor

NorthRealm commentedJul 7, 2025
edited
Loading

Note: For code reusability, there's a refactor/renaming inmail.go,mail_issue_common.go andmail_test.go inc8b64c7,ed7b2bc

@NorthRealm
Copy link
ContributorAuthor

1

@lunnylunny added this to the1.25.0 milestoneJul 7, 2025
@lunny
Copy link
Member

replace#33601

@wxiaoguang

This comment was marked as resolved.

@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJul 8, 2025
edited
Loading

outdated

And by reading the history discussions:

I think the concern is not addressed?should we send the email on "workflow job" level, or "workflow run" level? (I am not certain about the details, just FYI)


It looks right, the concerns in "Actions - send Email on Success/Failure#33601" should all be addressed. 🙏

@wxiaoguangwxiaoguang added the type/featureCompletely new functionality. Can only be merged if feature freeze is not active. labelJul 15, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJul 15, 2025
edited
Loading

Will explain more "bad smells" in old code that I have made changes to:

  1. It shouldn't duplicatelog.Error when usingServerError which already logs the err
  2. It shouldn't show 500 error page when the user input is invalid.
  3. It shouldn't setselected active for a dropdown item,selected andactive have different meanings
  4. It shouldn't duplicate{{if eq ...}}selected{{end}} when using dropdown, the input value is the selected one and the framework already handles it
  5. It shouldn't duplicaterel="noopener noreferer", it only makes the translation more difficult (the affect has been explained above)

Actually I can tolerate the nits in code (not serious bugs) if the PR was reviewed and merged by others, or I missed some of them. While if I am reviewing or writing code, I will always do my best to avoid the bad smells.

@lunnylunny merged commit0d00ec7 intogo-gitea:mainJul 16, 2025
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJul 16, 2025
@ankurk91
Copy link

@lunny
this will land in 1.25?😬 please

lunny reacted with thumbs up emoji

zjjhot added a commit to zjjhot/gitea that referenced this pull requestJul 16, 2025
* giteaofficial/main:  Send email on Workflow Run Success/Failure (go-gitea#34982)  [skip ci] Updated translations via Crowdin  Replace `poetry` with `uv` (go-gitea#35084)  nix flake update (go-gitea#35085)  Use monospace font in PR command line instructions (go-gitea#35074)  Add gitignore rules to exclude LLM instruction files (go-gitea#35076)  [skip ci] Updated translations via Crowdin  Fix form property assignment edge case (go-gitea#35073)  Improve submodule relative path handling (go-gitea#35056)  Fixed all grammatical errors in locale_en-US.ini (go-gitea#35053)  UI: add hover background to table rows in user and repo admin page (go-gitea#35072)
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJul 16, 2025
edited
Loading

Yes, it is in 1.25, great thanks to@NorthRealm and reviewers 🎉

You can use it by the nightly build:

eunrui reacted with thumbs up emojiankurk91, NorthRealm, and Mikescher reacted with heart emoji

@ghnp5
Copy link

Thank you so much for this!! 🥳🎉🧡

@NorthRealmNorthRealm deleted the patch4 branchJuly 16, 2025 08:11
@ghost
Copy link

@NorthRealm
How do I activate this feature? I have set up the mailer and the mailer seems to work. When clicking the Test button in the settings, the email is sent successfully. However, if a Action run fails, I do not get any emails.

@NorthRealm
Copy link
ContributorAuthor

@inxcts[service] ENABLE_NOTIFY_MAIL=true

jarbelix reacted with thumbs up emoji

@ghost
Copy link

@inxcts[service] ENABLE_NOTIFY_MAIL=true

I also set this variable to true and restarted Gitea. When an action run fails, I still do net any emails. I still something is still missing.

@NorthRealm
Copy link
ContributorAuthor

@inxcts I'm pretty sure that's the key. Manually tested on local instance (localhost) and it's working as intended. Do you have a valid email address in your account? Is your mailbox provider putting gitea emails into spam folder?

@ghost
Copy link

ghost commentedAug 4, 2025
edited by ghost
Loading

@NorthRealm

@inxcts I'm pretty sure that's the key. Manually tested on local instance (localhost) and it's working as intended. Do you have a valid email address in your account? Is your mailbox provider putting gitea emails into spam folder?

The spam folder is empty. In the mailer section of the app.ini, I have put an email address that is not in use by any Gitea user, it is just used as the email account that Gitea should use. In the "FROM" variable, I have put the email address from my main account.

When navigating to the settings page, the mailer seems to work. When typing an email address and clicking the Test button, the email is sent to my account (the same that should be used for the actions).

@NorthRealm
Copy link
ContributorAuthor

@inxcts Enable Gitea trace log and see if anything likeNew e-mail sending request []: Run failed(failed/cancelled/succeeded) appears. If yes, then I don't see any issue on Gitea. If no, it probably means:

  • Event is not triggered (not likely)
  • Trigger user not eligible to receive emails.
  • Trigger user has disabled action emails. (In current implementation it's independent from the existing email notification preference setting.)
  • Trigger user is not you.
  • Anywhere else that I have not noticed.
[mailer]ENABLED = trueSMTP_ADDR = mailbox.hostSMTP_PORT = 465PROTOCOL = smtpsFROM = noreply@email.domainUSER = noreply@email.domainPASSWD =

The above is my (dummy) mailer config. You usually don't "put the email address from your main account."

@ghost
Copy link

@NorthRealm

When I commit something and the action fails, I now get the email. The problem seems to be that the job is scheduled.

name: Nightly on: schedule: - cron: "0 0 * * *"

Is it possible to receive emails here or run the job with my user?

@NorthRealm
Copy link
ContributorAuthor

@inxcts I am not familiar with how Gitea determines trigger user. I looked at code base and did not find anywhere clear that logs an existing user as trigger user for a scheduled task. You get the email probably because of push trigger and you become the trigger user.
Prior in#23725 people had other workarounds.
To "run the job with your user", maybe trigger the run manually or with API?

@lunny
Copy link
Member

@inxcts Please notice this feature will be released in v1.25

@ghost
Copy link

@inxcts Please notice this feature will be released in v1.25

@lunny I know that this is a 1.25 feature, I am running the latest dev build.

@NorthRealm I think for scheduled builds, the repository owner should receive the emails(just like GitHub does), otherwise no one really knows that actions fail.

PhantomPhoton and lifeofguenter reacted with thumbs up emoji

@PhantomPhoton
Copy link

FWIW, I'm in agreement with inxcts. I'm more interested in receiving notifications for scheduled actions when they fail vs push actions, as with push actions, I'm actively doing something and know to check. Having to check the results manually every morning is a chore I wish to avoid. Just my two cents.

That said, I really appreciate the work and feature and am very thankful for the project.

lifeofguenter reacted with thumbs up emoji

@ChristopherHX
Copy link
Contributor

ChristopherHX commentedAug 11, 2025
edited
Loading

I think for scheduled builds, the repository owner should receive the emails(just like GitHub does)

My experience is different. The user who has changed the schedule trigger yaml most recently is the trigger of the run and email recipient on GitHub Actions, here is Gitea Actions the trigger and has no real user as target.

In very rare cases this is the repository owner for multi user projects.


There were discussions on how bad GitHubs behavior is, so it might make sense to actually use the repository owner for all non deliverable workflow failure notifications.

Some people might prefer, a repo setting to send all schedule failures to a custom user/team members / receive other event failures of other users as well.


Emoji Vote

  • 😀 The user who last changed the schedule workflow trigger yaml = trigger + email target, just like GitHub
  • 🚀 Use the owner for workflow emails without recipient,but orgs cannot receive emails, then the org owners need to looked up
  • 👀 Repository setting to specify target audience of workflow email notifications
NorthRealm, ghnp5, and ankurk91 reacted with laugh emojighnp5, PhantomPhoton, Aarup, and lifeofguenter reacted with eyes emoji

@ghnp5
Copy link

Thanks!! I suggest repository setting for email address, and if it's not set, default to "last changed".

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@ChristopherHXChristopherHXChristopherHX approved these changes

@lunnylunnylunny approved these changes

@wxiaoguangwxiaoguangwxiaoguang approved these changes

+1 more reviewer

@hiifonghiifonghiifong approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

🙋 Bounty claimlgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/goPull requests that update Go codemodifies/templatesThis PR modifies the template filesmodifies/translationtype/featureCompletely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Milestone

1.25.0

Development

Successfully merging this pull request may close these issues.

Actions - send Email on Success/Failure

11 participants

@NorthRealm@lunny@wxiaoguang@Naxdy@jonnytest1@ankurk91@ghnp5@PhantomPhoton@ChristopherHX@hiifong@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp