fix: check if steps are empty

This commit is contained in:
Jason Song 2023-01-03 16:26:12 +08:00
parent 66785e2450
commit cd2af5d4f2
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5

View File

@ -324,6 +324,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
return nil, false, err
}
if len(workflowJob.Steps) > 0 {
steps := make([]*ActionTaskStep, len(workflowJob.Steps))
for i, v := range workflowJob.Steps {
steps[i] = &ActionTaskStep{
@ -338,6 +339,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
return nil, false, err
}
task.Steps = steps
}
job.TaskID = task.ID
if n, err := UpdateRunJob(ctx, job, builder.Eq{"task_id": 0}); err != nil {