mirror of
https://github.com/thegeeklab/drone-yaml.git
synced 2024-11-21 17:40:39 +00:00
handle duplicate names in conversion
This commit is contained in:
parent
e68eb6cba4
commit
a338c245d7
@ -86,6 +86,14 @@ func Convert(d []byte) ([]byte, error) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
names := map[string]struct{}{}
|
||||||
|
for i, step := range pipeline.Steps {
|
||||||
|
if _, ok := names[step.Name]; ok {
|
||||||
|
step.Name = fmt.Sprintf("%s_%d", step.Name, i)
|
||||||
|
}
|
||||||
|
names[step.Name] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
pipeline.Volumes = toVolumes(from)
|
pipeline.Volumes = toVolumes(from)
|
||||||
pipeline.Trigger.Branch.Include = from.Branches.Include
|
pipeline.Trigger.Branch.Include = from.Branches.Include
|
||||||
pipeline.Trigger.Branch.Exclude = from.Branches.Exclude
|
pipeline.Trigger.Branch.Exclude = from.Branches.Exclude
|
||||||
|
Loading…
Reference in New Issue
Block a user