forgejo/templates/mail/actions/now_done.tmpl
forgejo-backport-action eb543dcbdb [v12.0/forgejo] fix(email): actions notification template confuses branch with PR (#8455)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8448

When a mail notification is sent because of a failed pull request run,
the body will show:

Branch: #661 (f57df45)

where #661 is the number of the pull request and not the branch. This
is because run.PrettyRef() is used and has a misleading special case
returning a PR number instead of a ref.

Remove the textual description as it can easily be discovered from the
run web page linked in the mail.

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8455
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-09 10:20:54 +02:00

38 lines
1.1 KiB
Go HTML Template

<!DOCTYPE html>
<html>
<head>
<style>
.footer { font-size:small; color:#666;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
{{$repo_link := HTMLFormat "<a href='%s'>%s</a>" .Run.Repo.HTMLURL .RepoFullName}}
{{$action_run_link := HTMLFormat "<a href='%s'>%s</a>" .Link .Run.Title}}
{{$trigger_user_link := HTMLFormat "<a href='%s'>@%s</a>" .Run.TriggerUser.HTMLURL .Run.TriggerUser.Name}}
<body>
<p>
{{if .IsSuccess}}
{{.locale.Tr "mail.actions.successful_run_after_failure" $action_run_link $repo_link}}
{{else}}
{{.locale.Tr "mail.actions.not_successful_run" $action_run_link $repo_link}}
{{end}}
<br />
{{.locale.Tr "mail.actions.run_info_cur_status" .Run.Status .PriorStatus}}<br />
{{.locale.Tr "mail.actions.run_info_sha" .CommitSHA}}<br />
{{if .LastRun}}
{{.locale.Tr "mail.actions.run_info_previous_status" .LastRun.Status}}<br />
{{end}}
{{.locale.Tr "mail.actions.run_info_trigger" .Run.TriggerEvent $trigger_user_link}}
</p>
<div class="footer">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
</p>
</div>
</body>
</html>