add target to launchpad configuration

Amine Hilaly created

Change summary

bridge/launchpad/config.go | 7 +++++++
1 file changed, 7 insertions(+)

Detailed changes

bridge/launchpad/config.go 🔗

@@ -17,7 +17,9 @@ import (
 var ErrBadProjectURL = errors.New("bad Launchpad project URL")
 
 const (
+	target         = "launchpad-preview"
 	keyProject     = "project"
+	keyTarget      = "target"
 	defaultTimeout = 60 * time.Second
 )
 
@@ -61,6 +63,7 @@ func (*Launchpad) Configure(repo repository.RepoCommon, params core.BridgeParams
 	}
 
 	conf[keyProject] = project
+	conf[keyTarget] = target
 	return conf, nil
 }
 
@@ -69,6 +72,10 @@ func (*Launchpad) ValidateConfig(conf core.Configuration) error {
 		return fmt.Errorf("missing %s key", keyProject)
 	}
 
+	if _, ok := conf[keyTarget]; !ok {
+		return fmt.Errorf("missing %s key", keyTarget)
+	}
+
 	return nil
 }