We are running different kind of validations using IPreprocessBuildWithReport.OnPreprocessBuild and when the validation fails we currently log an error, that developers see in their local builds. But as local builds are not that common we might miss these as Unity Cloud doesn’t fail the build or anyway indicate there was errors in the build without taking a look into the logs. Is there a way to make Unity Cloud build fail when doing the validation in IPreprocessBuildWithReport.OnPreprocessBuild?
EditorApplication.Exit(1); might do the trick - I’m not sure if it would work if you run it in OnPreprocessBuild though. If you run into issues with this approach then you might have more luck trying to run it inside of a Pre-Export Method