When executing the JFrog CLI command to scan a build using the following syntax:
jf bs <build name> <build number>You may encounter the following error:
[🚨Error] No Xray “Fail build in case of a violation” policy rule has been defined on this build. The Xray scan will run in parallel to the deployment of the build and will not obstruct the build. To review the Xray scan results, see the Xray Violations tab in the UI.This error message arises because Xray anticipates a build to be associated with a watch and policy that includes a "Fail Build" action. If the build is not linked to a watch with a policy containing this action, Xray will consistently return this error.
JFrog CLI is categorized as a CI/CD tool and is configured by default to terminate builds in the event of a potential scan violation. Consequently, if a build is not included in a watch or if the policy lacks the "Fail Build" action, it will result in a build failure based on security considerations.
To resolve this error message, please enable the "Fail Build" action in the relevant policy rule. This can be accomplished by navigating to the policy in the UI and either updating an existing policy rule or creating a new one with the "Fail Build" action activated, as demonstrated below.