mirror of
https://github.com/go-gitea/gitea
synced 2024-11-17 15:31:06 +01:00
parent
145baa2b3f
commit
e695ba4755
2 changed files with 9 additions and 0 deletions
|
@ -3638,6 +3638,7 @@ runs.pushed_by = pushed by
|
||||||
runs.invalid_workflow_helper = Workflow config file is invalid. Please check your config file: %s
|
runs.invalid_workflow_helper = Workflow config file is invalid. Please check your config file: %s
|
||||||
runs.no_matching_online_runner_helper = No matching online runner with label: %s
|
runs.no_matching_online_runner_helper = No matching online runner with label: %s
|
||||||
runs.no_job_without_needs = The workflow must contain at least one job without dependencies.
|
runs.no_job_without_needs = The workflow must contain at least one job without dependencies.
|
||||||
|
runs.no_job = The workflow must contain at least one job
|
||||||
runs.actor = Actor
|
runs.actor = Actor
|
||||||
runs.status = Status
|
runs.status = Status
|
||||||
runs.actors_no_select = All actors
|
runs.actors_no_select = All actors
|
||||||
|
|
|
@ -107,7 +107,12 @@ func List(ctx *context.Context) {
|
||||||
// The workflow must contain at least one job without "needs". Otherwise, a deadlock will occur and no jobs will be able to run.
|
// The workflow must contain at least one job without "needs". Otherwise, a deadlock will occur and no jobs will be able to run.
|
||||||
hasJobWithoutNeeds := false
|
hasJobWithoutNeeds := false
|
||||||
// Check whether have matching runner and a job without "needs"
|
// Check whether have matching runner and a job without "needs"
|
||||||
|
emptyJobsNumber := 0
|
||||||
for _, j := range wf.Jobs {
|
for _, j := range wf.Jobs {
|
||||||
|
if j == nil {
|
||||||
|
emptyJobsNumber++
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !hasJobWithoutNeeds && len(j.Needs()) == 0 {
|
if !hasJobWithoutNeeds && len(j.Needs()) == 0 {
|
||||||
hasJobWithoutNeeds = true
|
hasJobWithoutNeeds = true
|
||||||
}
|
}
|
||||||
|
@ -131,6 +136,9 @@ func List(ctx *context.Context) {
|
||||||
if !hasJobWithoutNeeds {
|
if !hasJobWithoutNeeds {
|
||||||
workflow.ErrMsg = ctx.Locale.TrString("actions.runs.no_job_without_needs")
|
workflow.ErrMsg = ctx.Locale.TrString("actions.runs.no_job_without_needs")
|
||||||
}
|
}
|
||||||
|
if emptyJobsNumber == len(wf.Jobs) {
|
||||||
|
workflow.ErrMsg = ctx.Locale.TrString("actions.runs.no_job")
|
||||||
|
}
|
||||||
workflows = append(workflows, workflow)
|
workflows = append(workflows, workflow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue