@@ -14,32 +14,21 @@ func buildTasks(ctx context.Context, spec *batcheslib.BatchSpec, workspaces []Re
1414 tasks := make ([]* executor.Task , 0 , len (workspaces ))
1515
1616 for _ , ws := range workspaces {
17- tasks = append (tasks , buildTask (spec , ws ))
17+ task := & executor.Task {
18+ Repository : ws .Repo ,
19+ Path : ws .Path ,
20+ Steps : ws .Steps ,
21+ OnlyFetchWorkspace : ws .OnlyFetchWorkspace ,
22+
23+ TransformChanges : spec .TransformChanges ,
24+ Template : spec .ChangesetTemplate ,
25+ BatchChangeAttributes : & template.BatchChangeAttributes {
26+ Name : spec .Name ,
27+ Description : spec .Description ,
28+ },
29+ }
30+ tasks = append (tasks , task )
1831 }
1932
2033 return tasks
2134}
22-
23- func buildTask (spec * batcheslib.BatchSpec , workspace RepoWorkspace ) * executor.Task {
24- batchChange := template.BatchChangeAttributes {
25- Name : spec .Name ,
26- Description : spec .Description ,
27- }
28-
29- // "." means the path is root, but in the executor we use "" to signify root.
30- path := workspace .Path
31- if path == "." {
32- path = ""
33- }
34-
35- return & executor.Task {
36- Repository : workspace .Repo ,
37- Path : path ,
38- Steps : workspace .Steps ,
39- OnlyFetchWorkspace : workspace .OnlyFetchWorkspace ,
40-
41- TransformChanges : spec .TransformChanges ,
42- Template : spec .ChangesetTemplate ,
43- BatchChangeAttributes : & batchChange ,
44- }
45- }
0 commit comments