99 "context"
1010 "errors"
1111 "fmt"
12+ "html/template"
1213 "io"
1314 "net/http"
1415 "net/url"
@@ -29,6 +30,7 @@ import (
2930 "code.gitea.io/gitea/modules/setting"
3031 "code.gitea.io/gitea/modules/storage"
3132 api "code.gitea.io/gitea/modules/structs"
33+ "code.gitea.io/gitea/modules/templates"
3234 "code.gitea.io/gitea/modules/timeutil"
3335 "code.gitea.io/gitea/modules/util"
3436 "code.gitea.io/gitea/modules/web"
@@ -87,19 +89,20 @@ type ViewResponse struct {
8789
8890 State struct {
8991 Run struct {
90- Link string `json:"link"`
91- Title string `json:"title"`
92- Status string `json:"status"`
93- CanCancel bool `json:"canCancel"`
94- CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve
95- CanRerun bool `json:"canRerun"`
96- CanDeleteArtifact bool `json:"canDeleteArtifact"`
97- Done bool `json:"done"`
98- WorkflowID string `json:"workflowID"`
99- WorkflowLink string `json:"workflowLink"`
100- IsSchedule bool `json:"isSchedule"`
101- Jobs []* ViewJob `json:"jobs"`
102- Commit ViewCommit `json:"commit"`
92+ Link string `json:"link"`
93+ Title string `json:"title"`
94+ TitleHTML template.HTML `json:"titleHTML"`
95+ Status string `json:"status"`
96+ CanCancel bool `json:"canCancel"`
97+ CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve
98+ CanRerun bool `json:"canRerun"`
99+ CanDeleteArtifact bool `json:"canDeleteArtifact"`
100+ Done bool `json:"done"`
101+ WorkflowID string `json:"workflowID"`
102+ WorkflowLink string `json:"workflowLink"`
103+ IsSchedule bool `json:"isSchedule"`
104+ Jobs []* ViewJob `json:"jobs"`
105+ Commit ViewCommit `json:"commit"`
103106 } `json:"run"`
104107 CurrentJob struct {
105108 Title string `json:"title"`
@@ -200,7 +203,10 @@ func ViewPost(ctx *context_module.Context) {
200203 }
201204 }
202205
206+ metas := ctx .Repo .Repository .ComposeMetas (ctx )
207+
203208 resp .State .Run .Title = run .Title
209+ resp .State .Run .TitleHTML = templates .NewRenderUtils (ctx ).RenderCommitMessage (run .Title , metas )
204210 resp .State .Run .Link = run .Link ()
205211 resp .State .Run .CanCancel = ! run .Status .IsDone () && ctx .Repo .CanWrite (unit .TypeActions )
206212 resp .State .Run .CanApprove = run .NeedApproval && ctx .Repo .CanWrite (unit .TypeActions )
0 commit comments