diff --git a/build/build.go b/build/build.go index 5030de4d..dc679d31 100644 --- a/build/build.go +++ b/build/build.go @@ -801,6 +801,9 @@ func BuildWithResultHandler(ctx context.Context, drivers []DriverInfo, opt map[s } for n, v := range gitLabels { if _, ok := opt.Labels[n]; !ok { + if opt.Labels == nil { + opt.Labels = map[string]string{} + } opt.Labels[n] = v } }