fix: handle go closure iteration (#1374)

Copy the matrix to make it closure aware
This commit is contained in:
Markus Wolf
2022-10-06 00:13:00 +02:00
committed by GitHub
parent 79384c35ab
commit 1bade27534

View File

@@ -121,6 +121,7 @@ func New(runnerConfig *Config) (Runner, error) {
}
// NewPlanExecutor ...
//
//nolint:gocyclo
func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
maxJobNameLen := 0
@@ -156,6 +157,7 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
}
for i, matrix := range matrixes {
matrix := matrix
rc := runner.newRunContext(ctx, run, matrix)
rc.JobName = rc.Name
if len(matrixes) > 1 {