summaryrefslogtreecommitdiffstats
path: root/services/actions/commit_status.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-02-11 07:34:11 +0100
committerGitHub <noreply@github.com>2023-02-11 07:34:11 +0100
commite9288c24773157411edec17c9bbcc8c1567e91ee (patch)
treeb34c730a13ab9a56d14b0fcccf1e136ca0233b68 /services/actions/commit_status.go
parentUse proxy for pull mirror (#22771) (diff)
downloadforgejo-e9288c24773157411edec17c9bbcc8c1567e91ee.tar.xz
forgejo-e9288c24773157411edec17c9bbcc8c1567e91ee.zip
Fix improper HTMLURL usages in Go code (#22839)
In Go code, HTMLURL should be only used for external systems, like API/webhook/mail/notification, etc. If a URL is used by `Redirect` or rendered in a template, it should be a relative URL (aka `Link()` in Gitea) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services/actions/commit_status.go')
-rw-r--r--services/actions/commit_status.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/actions/commit_status.go b/services/actions/commit_status.go
index c17f8ef153..efb5ec6d44 100644
--- a/services/actions/commit_status.go
+++ b/services/actions/commit_status.go
@@ -59,7 +59,7 @@ func CreateCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er
Creator: creator,
CommitStatus: &git_model.CommitStatus{
SHA: sha,
- TargetURL: run.HTMLURL(),
+ TargetURL: run.Link(),
Description: "",
Context: ctxname,
CreatorID: payload.Pusher.ID,