|
|
@ -67,6 +67,9 @@ type ViewResponse struct { |
|
|
|
CanRerun bool `json:"canRerun"` |
|
|
|
CanRerun bool `json:"canRerun"` |
|
|
|
CanDeleteArtifact bool `json:"canDeleteArtifact"` |
|
|
|
CanDeleteArtifact bool `json:"canDeleteArtifact"` |
|
|
|
Done bool `json:"done"` |
|
|
|
Done bool `json:"done"` |
|
|
|
|
|
|
|
WorkflowID string `json:"workflowID"` |
|
|
|
|
|
|
|
WorkflowLink string `json:"workflowLink"` |
|
|
|
|
|
|
|
IsSchedule bool `json:"isSchedule"` |
|
|
|
Jobs []*ViewJob `json:"jobs"` |
|
|
|
Jobs []*ViewJob `json:"jobs"` |
|
|
|
Commit ViewCommit `json:"commit"` |
|
|
|
Commit ViewCommit `json:"commit"` |
|
|
|
} `json:"run"` |
|
|
|
} `json:"run"` |
|
|
@ -90,12 +93,10 @@ type ViewJob struct { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type ViewCommit struct { |
|
|
|
type ViewCommit struct { |
|
|
|
LocaleCommit string `json:"localeCommit"` |
|
|
|
ShortSha string `json:"shortSHA"` |
|
|
|
LocalePushedBy string `json:"localePushedBy"` |
|
|
|
Link string `json:"link"` |
|
|
|
ShortSha string `json:"shortSHA"` |
|
|
|
Pusher ViewUser `json:"pusher"` |
|
|
|
Link string `json:"link"` |
|
|
|
Branch ViewBranch `json:"branch"` |
|
|
|
Pusher ViewUser `json:"pusher"` |
|
|
|
|
|
|
|
Branch ViewBranch `json:"branch"` |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type ViewUser struct { |
|
|
|
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.CanRerun = run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions) |
|
|
|
resp.State.Run.CanDeleteArtifact = 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.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.Jobs = make([]*ViewJob, 0, len(jobs)) // marshal to '[]' instead fo 'null' in json
|
|
|
|
resp.State.Run.Status = run.Status.String() |
|
|
|
resp.State.Run.Status = run.Status.String() |
|
|
|
for _, v := range jobs { |
|
|
|
for _, v := range jobs { |
|
|
@ -172,12 +176,10 @@ func ViewPost(ctx *context_module.Context) { |
|
|
|
Link: run.RefLink(), |
|
|
|
Link: run.RefLink(), |
|
|
|
} |
|
|
|
} |
|
|
|
resp.State.Run.Commit = ViewCommit{ |
|
|
|
resp.State.Run.Commit = ViewCommit{ |
|
|
|
LocaleCommit: ctx.Locale.TrString("actions.runs.commit"), |
|
|
|
ShortSha: base.ShortSha(run.CommitSHA), |
|
|
|
LocalePushedBy: ctx.Locale.TrString("actions.runs.pushed_by"), |
|
|
|
Link: fmt.Sprintf("%s/commit/%s", run.Repo.Link(), run.CommitSHA), |
|
|
|
ShortSha: base.ShortSha(run.CommitSHA), |
|
|
|
Pusher: pusher, |
|
|
|
Link: fmt.Sprintf("%s/commit/%s", run.Repo.Link(), run.CommitSHA), |
|
|
|
Branch: branch, |
|
|
|
Pusher: pusher, |
|
|
|
|
|
|
|
Branch: branch, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var task *actions_model.ActionTask |
|
|
|
var task *actions_model.ActionTask |
|
|
|