From fc862bf627d7456207827d0875d0f0f4b21b4e15 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Mon, 15 Aug 2022 11:52:30 +0200 Subject: [PATCH] Default clone do checkout tags on tag pipeline (#1110) --- pipeline/frontend/yaml/compiler/compiler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipeline/frontend/yaml/compiler/compiler.go b/pipeline/frontend/yaml/compiler/compiler.go index a76be917a..0ff6f31d4 100644 --- a/pipeline/frontend/yaml/compiler/compiler.go +++ b/pipeline/frontend/yaml/compiler/compiler.go @@ -128,10 +128,14 @@ func (c *Compiler) Compile(conf *yaml.Config) *backend.Config { if len(c.defaultCloneImage) > 0 { cloneImage = c.defaultCloneImage } + cloneSettings := map[string]interface{}{"depth": "0"} + if c.metadata.Curr.Event == frontend.EventTag { + cloneSettings["tags"] = "true" + } container := &yaml.Container{ Name: defaultCloneName, Image: cloneImage, - Settings: map[string]interface{}{"depth": "0"}, + Settings: cloneSettings, Environment: c.cloneEnv, } name := fmt.Sprintf("%s_clone", c.prefix)