File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3638,6 +3638,7 @@ runs.pushed_by = pushed by
36383638runs.invalid_workflow_helper = Workflow config file is invalid. Please check your config file: %s
36393639runs.no_matching_online_runner_helper = No matching online runner with label: %s
36403640runs.no_job_without_needs = The workflow must contain at least one job without dependencies.
3641+ runs.no_job = The workflow must contain at least one job
36413642runs.actor = Actor
36423643runs.status = Status
36433644runs.actors_no_select = All actors
Original file line number Diff line number Diff line change @@ -107,7 +107,12 @@ func List(ctx *context.Context) {
107107 // The workflow must contain at least one job without "needs". Otherwise, a deadlock will occur and no jobs will be able to run.
108108 hasJobWithoutNeeds := false
109109 // Check whether have matching runner and a job without "needs"
110+ emptyJobsNumber := 0
110111 for _ , j := range wf .Jobs {
112+ if j == nil {
113+ emptyJobsNumber ++
114+ continue
115+ }
111116 if ! hasJobWithoutNeeds && len (j .Needs ()) == 0 {
112117 hasJobWithoutNeeds = true
113118 }
@@ -131,6 +136,9 @@ func List(ctx *context.Context) {
131136 if ! hasJobWithoutNeeds {
132137 workflow .ErrMsg = ctx .Locale .TrString ("actions.runs.no_job_without_needs" )
133138 }
139+ if emptyJobsNumber == len (wf .Jobs ) {
140+ workflow .ErrMsg = ctx .Locale .TrString ("actions.runs.no_job" )
141+ }
134142 workflows = append (workflows , workflow )
135143 }
136144 }
You can’t perform that action at this time.
0 commit comments