Severity and exit codes in Policy check automation
When you run policy checks on a changelog file manually, the CLI output may contain warning messages from triggered checks.
When you deploy Liquibase jobs automatically, you may not directly review the CLI or log file output. Therefore, your automation tools need an exit code configured for your specific needs and an assessment of the checks' severity to determine if the job moves forward or stops.
You can specify a custom exit code for each policy check specified in a checks settings file. Also, the Checks Report displays the severity level associated with each check that was triggered.
Note: When multiple checks are triggered, Liquibase returns the highest exit code of all the triggered checks. This exit code can be detected and processed by automation tools with the echo $?
command for Linux or the echo ?
command for Windows. Also, if you use policy checks in a flow file, Liquibase 4.24.0 returns the highest exit code specified.
