File tree 2 files changed +9
-0
lines changed 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3637,6 +3637,7 @@ runs.pushed_by = pushed by
3637
3637
runs.invalid_workflow_helper = Workflow config file is invalid. Please check your config file: %s
3638
3638
runs.no_matching_online_runner_helper = No matching online runner with label: %s
3639
3639
runs.no_job_without_needs = The workflow must contain at least one job without dependencies.
3640
+ runs.no_job = The workflow must contain at least one job
3640
3641
runs.actor = Actor
3641
3642
runs.status = Status
3642
3643
runs.actors_no_select = All actors
Original file line number Diff line number Diff line change @@ -107,7 +107,12 @@ func List(ctx *context.Context) {
107
107
// The workflow must contain at least one job without "needs". Otherwise, a deadlock will occur and no jobs will be able to run.
108
108
hasJobWithoutNeeds := false
109
109
// Check whether have matching runner and a job without "needs"
110
+ emptyJobsNumber := 0
110
111
for _ , j := range wf .Jobs {
112
+ if j == nil {
113
+ emptyJobsNumber ++
114
+ continue
115
+ }
111
116
if ! hasJobWithoutNeeds && len (j .Needs ()) == 0 {
112
117
hasJobWithoutNeeds = true
113
118
}
@@ -131,6 +136,9 @@ func List(ctx *context.Context) {
131
136
if ! hasJobWithoutNeeds {
132
137
workflow .ErrMsg = ctx .Locale .TrString ("actions.runs.no_job_without_needs" )
133
138
}
139
+ if emptyJobsNumber == len (wf .Jobs ) {
140
+ workflow .ErrMsg = ctx .Locale .TrString ("actions.runs.no_job" )
141
+ }
134
142
workflows = append (workflows , workflow )
135
143
}
136
144
}
You can’t perform that action at this time.
0 commit comments