From 5d4a275cb1a324dae067c2c09e51a2914c371a93 Mon Sep 17 00:00:00 2001 From: Mark Bruning Date: Wed, 7 Aug 2019 16:54:20 -0500 Subject: [PATCH] feat(aws-codebuild): support pull_request_merged eventaction type (#3575) * feat(aws-codebuild): support pull_request_merged eventaction type Added PULL_REQUEST_MERGED type to the EventAction Enum for use in source webhook filter groups closes #3557 * feat(aws-codebuild): fix trailing comma in codebuild test file --- packages/@aws-cdk/aws-codebuild/lib/source.ts | 7 ++++++- packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-codebuild/lib/source.ts b/packages/@aws-cdk/aws-codebuild/lib/source.ts index 3cd171287b572..4f2abf5a287c9 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/source.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/source.ts @@ -143,10 +143,15 @@ export enum EventAction { PULL_REQUEST_CREATED = 'PULL_REQUEST_CREATED', /** - * Updating an Pull Request. + * Updating a Pull Request. */ PULL_REQUEST_UPDATED = 'PULL_REQUEST_UPDATED', + /** + * Merging a Pull Request. + */ + PULL_REQUEST_MERGED = 'PULL_REQUEST_MERGED', + /** * Re-opening a previously closed Pull Request. * Note that this event is only supported for GitHub and GitHubEnterprise sources. diff --git a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts index 677368230568e..28526e756dcf0 100644 --- a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts +++ b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts @@ -581,6 +581,7 @@ export = { codebuild.FilterGroup.inEventOf( codebuild.EventAction.PULL_REQUEST_CREATED, codebuild.EventAction.PULL_REQUEST_UPDATED, + codebuild.EventAction.PULL_REQUEST_MERGED, ).andTagIs('v.*'), // duplicate event actions are fine codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH, codebuild.EventAction.PUSH).andActorAccountIsNot('aws-cdk-dev'), @@ -602,7 +603,7 @@ export = { Webhook: true, FilterGroups: [ [ - { Type: 'EVENT', Pattern: 'PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED' }, + { Type: 'EVENT', Pattern: 'PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, PULL_REQUEST_MERGED' }, { Type: 'HEAD_REF', Pattern: 'refs/tags/v.*' }, ], [