aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/actions/view.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go
index 41989589be..c4b46ea7fa 100644
--- a/routers/web/repo/actions/view.go
+++ b/routers/web/repo/actions/view.go
@@ -67,6 +67,9 @@ type ViewResponse struct {
CanRerun bool `json:"canRerun"`
CanDeleteArtifact bool `json:"canDeleteArtifact"`
Done bool `json:"done"`
+ WorkflowID string `json:"workflowID"`
+ WorkflowLink string `json:"workflowLink"`
+ IsSchedule bool `json:"isSchedule"`
Jobs []*ViewJob `json:"jobs"`
Commit ViewCommit `json:"commit"`
} `json:"run"`
@@ -90,12 +93,10 @@ type ViewJob struct {
}
type ViewCommit struct {
- LocaleCommit string `json:"localeCommit"`
- LocalePushedBy string `json:"localePushedBy"`
- ShortSha string `json:"shortSHA"`
- Link string `json:"link"`
- Pusher ViewUser `json:"pusher"`
- Branch ViewBranch `json:"branch"`
+ ShortSha string `json:"shortSHA"`
+ Link string `json:"link"`
+ Pusher ViewUser `json:"pusher"`
+ Branch ViewBranch `json:"branch"`
}
type ViewUser struct {
@@ -151,6 +152,9 @@ func ViewPost(ctx *context_module.Context) {
resp.State.Run.CanRerun = run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions)
resp.State.Run.CanDeleteArtifact = run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions)
resp.State.Run.Done = run.Status.IsDone()
+ resp.State.Run.WorkflowID = run.WorkflowID
+ resp.State.Run.WorkflowLink = run.WorkflowLink()
+ resp.State.Run.IsSchedule = run.IsSchedule()
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 {
@@ -172,12 +176,10 @@ func ViewPost(ctx *context_module.Context) {
Link: run.RefLink(),
}
resp.State.Run.Commit = ViewCommit{
- LocaleCommit: ctx.Locale.TrString("actions.runs.commit"),
- LocalePushedBy: ctx.Locale.TrString("actions.runs.pushed_by"),
- ShortSha: base.ShortSha(run.CommitSHA),
- Link: fmt.Sprintf("%s/commit/%s", run.Repo.Link(), run.CommitSHA),
- Pusher: pusher,
- Branch: branch,
+ ShortSha: base.ShortSha(run.CommitSHA),
+ Link: fmt.Sprintf("%s/commit/%s", run.Repo.Link(), run.CommitSHA),
+ Pusher: pusher,
+ Branch: branch,
}
var task *actions_model.ActionTask