Only provide version ot build-frontend-packages if it's a valid semver (has 2 digits) (#57808) (#57810)

(cherry picked from commit fd16cad7da)

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-10-28 11:26:22 +02:00
committed by GitHub
co-authored by Kevin Minehart
parent a62cb4e6c1
commit 43d3f21ff0
+5 -1
View File
@@ -13,7 +13,11 @@ import (
func BuildFrontendPackages(c *cli.Context) error {
version := ""
if c.NArg() == 1 {
version = strings.TrimPrefix(c.Args().Get(0), "v")
// Fixes scenario where an incompatible semver is provided to lerna, which will cause the step to fail.
// When there is an invalid semver, a frontend package won't be published anyways.
if strings.Count(version, ".") == 2 {
version = strings.TrimPrefix(c.Args().Get(0), "v")
}
}
cfg, mode, err := frontend.GetConfig(c, version)