diff options
author | yp05327 | 2023-03-04 14:41:37 +0900 |
---|---|---|
committer | GitHub | 2023-03-04 00:41:37 -0500 |
commit | ca84a61761dc78fea7afe5a692deac7db5368dff (patch) | |
tree | 847c0602fb547b6bb02ac661890e14367381c6d3 /routers | |
parent | af4b00c2836342e8bb76a68ad3d05420c2ee6988 (diff) |
Add run status in action view page (#23212)
Before:
![image](https://user-images.githubusercontent.com/18380374/222084932-a7643fbe-2d9f-48db-b25d-74ace49e03f4.png)
![image](https://user-images.githubusercontent.com/18380374/222084887-fde3500d-dad3-4902-9c82-c4f71f23f83b.png)
After:
![image](https://user-images.githubusercontent.com/18380374/222084565-eeef1110-9d9d-40b4-a26b-fbd5a307f14e.png)
![image](https://user-images.githubusercontent.com/18380374/222084728-6c96d7c1-a399-43d5-8369-392ad5017b7f.png)
---------
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/actions/view.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index dd2750f90..556970936 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -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"` CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve Done bool `json:"done"` @@ -111,6 +112,7 @@ func ViewPost(ctx *context_module.Context) { resp.State.Run.CanApprove = run.NeedApproval && 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, |