Bugfix - audit ignores JFROG_CLI_BUILD_PROJECT env
@@ -374,7 +374,7 @@ func createServerDetailsWithConfigOffer(c *cli.Context) (*coreconfig.ServerDetai
func shouldIncludeVulnerabilities(c *cli.Context) bool {
// If no context was provided by the user, no Violations will be triggered by Xray, so include general vulnerabilities in the command output
- return c.String("watches") == "" && c.String("project") == "" && c.String("repo-path") == ""
+ return c.String("watches") == "" && isProjectProvided(c) && c.String("repo-path") == ""
}
func validateXrayContext(c *cli.Context) error {
@@ -382,7 +382,7 @@ func validateXrayContext(c *cli.Context) error {
if c.String("watches") != "" {
contextFlag++
}
- if c.String("project") != "" {
+ if isProjectProvided(c) {
contextFlag++
}
if c.String("repo-path") != "" {
@@ -393,3 +393,7 @@ func validateXrayContext(c *cli.Context) error {
}
return nil
}
+
+func isProjectProvided(c *cli.Context) bool {
+ return c.String("project") != "" || os.Getenv(coreutils.Project) != ""
+}
