From 574182e1eb9b2a0b35b7940c11563f07499c40ee Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 3 Mar 2023 12:41:00 -0500 Subject: [PATCH] Revert relative links to absolute links in mail templates (#23267) (#23269) Backport #23267 Follow #21986 , fix regression. The mail templates should always use `AppURL` (the full absolute URL) Co-authored-by: wxiaoguang --- templates/mail/issue/assigned.tmpl | 2 +- templates/mail/issue/default.tmpl | 6 +++--- templates/mail/release.tmpl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl index 232a41b56f8..05bed690222 100644 --- a/templates/mail/issue/assigned.tmpl +++ b/templates/mail/issue/assigned.tmpl @@ -8,7 +8,7 @@ {{.Subject}} -{{$repo_url := printf "%s" (Escape .Issue.Repo.Link) (Escape .Issue.Repo.FullName)}} +{{$repo_url := printf "%s" (Escape .Issue.Repo.HTMLURL) (Escape .Issue.Repo.FullName)}} {{$link := printf "#%d" (Escape .Link) .Issue.Index}}

diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl index 3bda408a058..64dbb3df681 100644 --- a/templates/mail/issue/default.tmpl +++ b/templates/mail/issue/default.tmpl @@ -20,11 +20,11 @@ {{if eq .ActionName "push"}}

{{if .Comment.IsForcePush}} - {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.OldCommit}} + {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}} {{$oldShortSha := ShortSha .Comment.OldCommit}} {{$oldCommitLink := printf "%[2]s" (Escape $oldCommitUrl) (Escape $oldShortSha)}} - {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.NewCommit}} + {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}} {{$newShortSha := ShortSha .Comment.NewCommit}} {{$newCommitLink := printf "%[2]s" (Escape $newCommitUrl) (Escape $newShortSha)}} @@ -72,7 +72,7 @@