UserDefinedContextCheck

Last updated: January 30, 2026

Ensures changeset CONTEXT contains specific words or patterns, helping enforce that all changes are properly tagged for environment targeting, helping maintain consistent environment targeting across your deployment pipeline and preventing errors from misspelled or non-standard context names.

This check only allows you to use lowercase labels. It does not allow you to check for case-sensitive matching for any patterns with capital letters.

Uses

Property

Value

Liquibase version required

4.25.0+

Scope (--checks-scope)

changelog

Default status

disabled

Default severity (exit code)

0 ("INFO")

Customizable settings

Yes (dynamic)

Before you begin

  1. Ensure that you have correctly specified your Liquibase Secure license key.

  2. Ensure that the --checks-scope parameter includes the scope of this check.

Changelog checks prerequisites

loading

loading

loading

loading

loading

Procedure

1

Enable

This check is disabled by default. To enable it, run the checks enable command:

liquibase checks enable --check-name=<string>

When you try to enable the check, Liquibase displays the following message:

This check can not be enabled directly because one or more fields does not have a default value. Create a copy of this check and initiate the customization workflow.

Liquibase then prompts you to specify a name for the new check. By default, the name of the copy is <CheckName>1. You can use the default value by pressing Enter or you can specify a custom name.

2

Customize

This check is dynamic, meaning you can customize its settings. See the table on this page for more information.

1. Once you've enabled the check, follow the steps in the CLI to set new values.

Default values are shown in [brackets]. You can use these by pressing Enter. Alternatively, specify custom values. If a customization setting does not have a default value, you must specify custom values.

2. When finished, verify that your configuration is correct by running the checks show command.

liquibase checks show --check-name=<string>

3. If you need to make any other changes, run the checks customize command:

liquibase checks customize --check-name=<string>

Note: If you want to create another variant of this check with different settings, use the checks copy command to create a copy of the original check and then use the checks customize command to customize it.

3

Run

To run the check, use the checks run command.

loading

loading

Customization settings

Attribute Name

Type

Description

Customization

Default Value

OPERATOR

String/enum

The location to look for the provided SEARCH_STRING value

STARTS_WITH – Value of SEARCH_STRING should be found at the beginning of the table.

ENDS_WITH – Value of SEARCH_STRING should be found at the end of the table.

CONTAINS – Value of SEARCH_STRING can be anywhere in the table.

REGEXP – Value of SEARCH_STRING is a regexp that should be matched.

EQUALS - Value of SEARCH_STRING should equal this entry.

STARTS_WITH

SEARCH_STRING

String/enum

The substring or regular expression to match with the one in the changelog file. Cannot be empty.

Must be true or false.

--

SEVERITY

String/enum

Set the severity to return a code of 0–4 when the check is triggered. Default: 0.

'INFO' | 0

'MINOR' | 1

'MAJOR' | 2

'CRITICAL' | 3

'BLOCKER' | 4

'INFO' | 0