During the pipeline execution, at any point where you feel it is appropriate, call the command
accurics plan -config=config_file -fail for Accurics CLI to scan your IaC code to detect violations. When you use the -fail flag, Accurics CLI returns “1” if high severity violations are detected in the IaC code. This automatically fails your build or pipeline.
If the build doesn’t fail, you can gracefully fail the build by adding one more statement after the accurics plan command as follows:
if [ $? -eq 0 ]; then exit 0; else exit 1; fi