Skip to content
v2.277.0

EventAction Enum ​

The types of webhook event actions.

Example ​

ts
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
});
python
git_hub_source = codebuild.Source.git_hub(
    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
    webhook_triggers_batch_build=True,  # optional, default is false
    webhook_filters=[
        codebuild.FilterGroup.in_event_of(codebuild.EventAction.PUSH).and_branch_is("main").and_commit_message_is("the commit message"),
        codebuild.FilterGroup.in_event_of(codebuild.EventAction.RELEASED).and_branch_is("main")
    ]
)
java
ISource gitHubSource = Source.gitHub(GitHubSourceProps.builder()
        .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(List.of(FilterGroup.inEventOf(EventAction.PUSH).andBranchIs("main").andCommitMessageIs("the commit message"), FilterGroup.inEventOf(EventAction.RELEASED).andBranchIs("main")))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var gitHubSource = Source.GitHub(new GitHubSourceProps {
    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 = new [] { FilterGroup.InEventOf(EventAction.PUSH).AndBranchIs("main").AndCommitMessageIs("the commit message"), FilterGroup.InEventOf(EventAction.RELEASED).AndBranchIs("main") }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
gitHubSource := codebuild.Source_GitHub(&GitHubSourceProps{
	Owner: jsii.String("awslabs"),
	Repo: jsii.String("aws-cdk"),
	 // optional, default: undefined if unspecified will create organization webhook
	Webhook: jsii.Boolean(true),
	 // optional, default: true if `webhookFilters` were provided, false otherwise
	WebhookTriggersBatchBuild: jsii.Boolean(true),
	 // optional, default is false
	WebhookFilters: []FilterGroup{
		codebuild.FilterGroup_InEventOf(codebuild.EventAction_PUSH).AndBranchIs(jsii.String("main")).AndCommitMessageIs(jsii.String("the commit message")),
		codebuild.FilterGroup_*InEventOf(codebuild.EventAction_RELEASED).*AndBranchIs(jsii.String("main")),
	},
})

Members ​

MemberDescription
PUSHA push (of a branch, or a tag) to the repository.
PULL_REQUEST_CREATEDCreating a Pull Request.
PULL_REQUEST_UPDATEDUpdating a Pull Request.
PULL_REQUEST_CLOSEDClosing a Pull Request.
PULL_REQUEST_MERGEDMerging a Pull Request.
PULL_REQUEST_REOPENEDRe-opening a previously closed Pull Request.
RELEASEDA release is created in the repository.
PRERELEASEDA prerelease is created in the repository.
WORKFLOW_JOB_QUEUEDA workflow job is queued in the repository.