class FilterGroup
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeBuild.FilterGroup |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#FilterGroup |
Java | software.amazon.awscdk.services.codebuild.FilterGroup |
Python | aws_cdk.aws_codebuild.FilterGroup |
TypeScript (source) | aws-cdk-lib » aws_codebuild » FilterGroup |
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 #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.
Example
const gitHubSource = codebuild.Source.gitHub({
owner: 'awslabs',
repo: 'aws-cdk', // optional, default: undefined if unspecified will create organization webhook
webhook: true, // optional, default: true if `webhookFilters` were provided, false otherwise
webhookTriggersBatchBuild: true, // optional, default is false
webhookFilters: [
codebuild.FilterGroup
.inEventOf(codebuild.EventAction.PUSH)
.andBranchIs('main')
.andCommitMessageIs('the commit message'),
codebuild.FilterGroup
.inEventOf(codebuild.EventAction.RELEASED)
.andBranchIs('main')
], // optional, by default all pushes and Pull Requests will trigger a build
});
Methods
Name | Description |
---|---|
and | Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern. |
and | Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern. |
and | Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given base branch. |
and | 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. |
and | Create a new FilterGroup with an added condition: the Pull Request that is the source of the event must target the given Git reference. |
and | 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. |
and | Create a new FilterGroup with an added condition: the event must affect the given branch. |
and | Create a new FilterGroup with an added condition: the event must not affect the given branch. |
and | Create a new FilterGroup with an added condition: the event must affect a head commit with the given message. |
and | Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message. |
and | 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. |
and | 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. |
and | 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. |
and | 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. |
and | Create a new FilterGroup with an added condition: the push that is the source of the event affect only a repository name that matches the given pattern. |
and | Create a new FilterGroup with an added condition: the push that is the source of the event must not affect a repository name that matches the given pattern. |
and | Create a new FilterGroup with an added condition: the event must affect the given tag. |
and | Create a new FilterGroup with an added condition: the event must not affect the given tag. |
static in | Creates a new event FilterGroup that triggers on any of the provided actions. |
ActorAccountIs(pattern)
andpublic andActorAccountIs(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must match the given pattern.
ActorAccountIsNot(pattern)
andpublic andActorAccountIsNot(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
Create a new FilterGroup with an added condition: the account ID of the actor initiating the event must not match the given pattern.
BaseBranchIs(branchName)
andpublic andBaseBranchIs(branchName: string): FilterGroup
Parameters
- branchName
string
— the name of the branch (can be a regular expression).
Returns
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.
BaseBranchIsNot(branchName)
andpublic andBaseBranchIsNot(branchName: string): FilterGroup
Parameters
- branchName
string
— the name of the branch (can be a regular expression).
Returns
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.
BaseRefIs(pattern)
andpublic andBaseRefIs(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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.
BaseRefIsNot(pattern)
andpublic andBaseRefIsNot(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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.
BranchIs(branchName)
andpublic andBranchIs(branchName: string): FilterGroup
Parameters
- branchName
string
— the name of the branch (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must affect the given branch.
BranchIsNot(branchName)
andpublic andBranchIsNot(branchName: string): FilterGroup
Parameters
- branchName
string
— the name of the branch (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must not affect the given branch.
CommitMessageIs(commitMessage)
andpublic andCommitMessageIs(commitMessage: string): FilterGroup
Parameters
- commitMessage
string
— the commit message (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must affect a head commit with the given message.
CommitMessageIsNot(commitMessage)
andpublic andCommitMessageIsNot(commitMessage: string): FilterGroup
Parameters
- commitMessage
string
— the commit message (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must not affect a head commit with the given message.
FilePathIs(pattern)
andpublic andFilePathIs(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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, Bitbucket and GitHubEnterprise sources.
FilePathIsNot(pattern)
andpublic andFilePathIsNot(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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, Bitbucket and GitHubEnterprise sources.
HeadRefIs(pattern)
andpublic andHeadRefIs(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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.
HeadRefIsNot(pattern)
andpublic andHeadRefIsNot(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
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.
RepositoryNameIs(pattern)
andpublic andRepositoryNameIs(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
Create a new FilterGroup with an added condition: the push that is the source of the event affect only a repository name that matches the given pattern.
Note that you can only use this method if this Group contains only the WORKFLOW_JOB_QUEUED
event action,
only for GitHub sources and only for organization webhook.
RepositoryNameIsNot(pattern)
andpublic andRepositoryNameIsNot(pattern: string): FilterGroup
Parameters
- pattern
string
— a regular expression.
Returns
Create a new FilterGroup with an added condition: the push that is the source of the event must not affect a repository name that matches the given pattern.
Note that you can only use this method if this Group contains only the WORKFLOW_JOB_QUEUED
event action,
only for GitHub sources and only for organization webhook.
TagIs(tagName)
andpublic andTagIs(tagName: string): FilterGroup
Parameters
- tagName
string
— the name of the tag (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must affect the given tag.
TagIsNot(tagName)
andpublic andTagIsNot(tagName: string): FilterGroup
Parameters
- tagName
string
— the name of the tag (can be a regular expression).
Returns
Create a new FilterGroup with an added condition: the event must not affect the given tag.
EventOf(...actions)
static inpublic static inEventOf(...actions: EventAction[]): FilterGroup
Parameters
- actions
Event
— the actions to trigger the webhook on.Action
Returns
Creates a new event FilterGroup that triggers on any of the provided actions.