@@ -194,20 +194,19 @@ func DispatchActionWorkflow(ctx *context.APIContext, workflowID string, opt *api
194
194
return
195
195
}
196
196
workflows , err := jobparser .Parse (content )
197
- if err != nil || len ( workflows ) == 0 {
197
+ if err != nil {
198
198
ctx .Error (http .StatusInternalServerError , "WorkflowParseError" , err .Error ())
199
199
return
200
200
}
201
+ if len (workflows ) == 0 {
202
+ ctx .Error (http .StatusNotFound , "WorkflowNotFound" , fmt .Sprintf ("workflow '%s' is not found" , workflowID ))
203
+ return
204
+ }
201
205
workflow = workflows [0 ]
202
206
break
203
207
}
204
208
}
205
209
206
- if workflow == nil {
207
- ctx .Error (http .StatusNotFound , "WorkflowNotFound" , fmt .Sprintf ("workflow '%s' is not found" , workflowID ))
208
- return
209
- }
210
-
211
210
// Process workflow inputs
212
211
inputs := processWorkflowInputs (opt , & model.Workflow {
213
212
RawOn : workflow .RawOn ,
@@ -256,7 +255,8 @@ func DispatchActionWorkflow(ctx *context.APIContext, workflowID string, opt *api
256
255
CreateCommitStatus (ctx , alljobs ... )
257
256
}
258
257
259
- func processWorkflowInputs (opt * api.CreateActionWorkflowDispatch , workflow * model.Workflow ) map [string ]any {
258
+ func processWorkflowInputs (opt * api.CreateActionWorkflowDispatch , workflow * model.Workflow ) map [string ]api.ActionWorkflowDispatchInput {
259
+ // @see https://gitea.com/gitea/act/src/branch/main/pkg/jobparser/model.go#L207-L242
260
260
inputs := make (map [string ]any )
261
261
if workflowDispatch := workflow .WorkflowDispatchConfig (); workflowDispatch != nil {
262
262
for name , config := range workflowDispatch .Inputs {
0 commit comments