FilterGroup

class aws_cdk.aws_codebuild.FilterGroup

Bases: object

An object that represents a group of filter conditions for a webhook.

Every condition in a given FilterGroup must be true in order for the whole group to be true. You construct instances of it by calling the {@link #inEventOf} static factory method, and then calling various andXyz instance methods to create modified instances of it (this class is immutable).

You pass instances of this class to the webhookFilters property when constructing a source.

Methods

and_actor_account_is(pattern)

Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_actor_account_is_not(pattern)

Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_base_branch_is(branch_name)

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters

branch_name (str) – the name of the branch (can be a regular expression).

Return type

FilterGroup

and_base_branch_is_not(branch_name)

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must not target the given base branch.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters

branch_name (str) – the name of the branch (can be a regular expression).

Return type

FilterGroup

and_base_ref_is(pattern)

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_base_ref_is_not(pattern)

Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must not target the given Git reference.

Note that you cannot use this method if this Group contains the PUSH event action.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_branch_is(branch_name)

Create a new FilterGroup with an added condition: the event must affect the given branch.

Parameters

branch_name (str) – the name of the branch (can be a regular expression).

Return type

FilterGroup

and_branch_is_not(branch_name)

Create a new FilterGroup with an added condition: the event must not affect the given branch.

Parameters

branch_name (str) – the name of the branch (can be a regular expression).

Return type

FilterGroup

and_file_path_is(pattern)

Create a new FilterGroup with an added condition: the push that is the source of the event must affect a file that matches the given pattern.

Note that you can only use this method if this Group contains only the PUSH event action, and only for GitHub and GitHubEnterprise sources.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_file_path_is_not(pattern)

Create a new FilterGroup with an added condition: the push that is the source of the event must not affect a file that matches the given pattern.

Note that you can only use this method if this Group contains only the PUSH event action, and only for GitHub and GitHubEnterprise sources.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_head_ref_is(pattern)

Create a new FilterGroup with an added condition: the event must affect a Git reference (ie., a branch or a tag) that matches the given pattern.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_head_ref_is_not(pattern)

Create a new FilterGroup with an added condition: the event must not affect a Git reference (ie., a branch or a tag) that matches the given pattern.

Parameters

pattern (str) – a regular expression.

Return type

FilterGroup

and_tag_is(tag_name)

Create a new FilterGroup with an added condition: the event must affect the given tag.

Parameters

tag_name (str) – the name of the tag (can be a regular expression).

Return type

FilterGroup

and_tag_is_not(tag_name)

Create a new FilterGroup with an added condition: the event must not affect the given tag.

Parameters

tag_name (str) – the name of the tag (can be a regular expression).

Return type

FilterGroup

Static Methods

classmethod in_event_of(*actions)

Creates a new event FilterGroup that triggers on any of the provided actions.

Parameters

actions (EventAction) – the actions to trigger the webhook on.

Return type

FilterGroup