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

This commit is contained in:
Kevin Minehart
2022-10-28 11:04:59 +02:00
committed by GitHub
parent 5edd511461
commit fd16cad7da

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)