mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 12:21:03 +00:00
default git if not set
This commit is contained in:
parent
6c1a1d4be3
commit
18fdffd787
1 changed files with 9 additions and 5 deletions
|
@ -6,15 +6,19 @@ const clone = "clone"
|
|||
|
||||
// Clone transforms the Yaml to include a clone step.
|
||||
func Clone(c *yaml.Config, plugin string) error {
|
||||
for _, p := range c.Pipeline {
|
||||
if p.Name == clone {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
if plugin == "" {
|
||||
plugin = "git"
|
||||
}
|
||||
|
||||
for _, p := range c.Pipeline {
|
||||
if p.Name == clone {
|
||||
if p.Image == "" {
|
||||
p.Image = plugin
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
s := &yaml.Container{
|
||||
Image: plugin,
|
||||
Name: clone,
|
||||
|
|
Loading…
Reference in a new issue