1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 02:58:20 +00:00

Add run status in action view page (#24223)

Backport #23212
This commit is contained in:
yp05327
2023-04-20 16:24:50 +09:00
committed by GitHub
parent 7d717e22a8
commit 95c2cb4b79
2 changed files with 10 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ type ViewResponse struct {
Run struct {
Link string `json:"link"`
Title string `json:"title"`
Status string `json:"status"`
CanCancel bool `json:"canCancel"`
Done bool `json:"done"`
Jobs []*ViewJob `json:"jobs"`
@@ -109,6 +110,7 @@ func ViewPost(ctx *context_module.Context) {
resp.State.Run.CanCancel = !run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions)
resp.State.Run.Done = run.Status.IsDone()
resp.State.Run.Jobs = make([]*ViewJob, 0, len(jobs)) // marshal to '[]' instead fo 'null' in json
resp.State.Run.Status = run.Status.String()
for _, v := range jobs {
resp.State.Run.Jobs = append(resp.State.Run.Jobs, &ViewJob{
ID: v.ID,