# GitPullRequestFilter

Git pull request filter for trigger.

- Source: [`aws-codepipeline/lib/trigger.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codepipeline/lib/trigger.ts#L39)
- Type last changed: v2.142.0 · 16 May 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';
const gitPullRequestFilter: codepipeline.GitPullRequestFilter = {
  branchesExcludes: ['branchesExcludes'],
  branchesIncludes: ['branchesIncludes'],
  events: [codepipeline.GitPullRequestEvent.OPEN],
  filePathsExcludes: ['filePathsExcludes'],
  filePathsIncludes: ['filePathsIncludes'],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codepipeline as codepipeline

git_pull_request_filter = codepipeline.GitPullRequestFilter(
    branches_excludes=["branchesExcludes"],
    branches_includes=["branchesIncludes"],
    events=[codepipeline.GitPullRequestEvent.OPEN],
    file_paths_excludes=["filePathsExcludes"],
    file_paths_includes=["filePathsIncludes"]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codepipeline.*;

GitPullRequestFilter gitPullRequestFilter = GitPullRequestFilter.builder()
        .branchesExcludes(List.of("branchesExcludes"))
        .branchesIncludes(List.of("branchesIncludes"))
        .events(List.of(GitPullRequestEvent.OPEN))
        .filePathsExcludes(List.of("filePathsExcludes"))
        .filePathsIncludes(List.of("filePathsIncludes"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodePipeline;

var gitPullRequestFilter = new GitPullRequestFilter {
    BranchesExcludes = new [] { "branchesExcludes" },
    BranchesIncludes = new [] { "branchesIncludes" },
    Events = new [] { GitPullRequestEvent.OPEN },
    FilePathsExcludes = new [] { "filePathsExcludes" },
    FilePathsIncludes = new [] { "filePathsIncludes" }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

gitPullRequestFilter := &GitPullRequestFilter{
	BranchesExcludes: []*string{
		jsii.String("branchesExcludes"),
	},
	BranchesIncludes: []*string{
		jsii.String("branchesIncludes"),
	},
	Events: []GitPullRequestEvent{
		awscdk.Aws_codepipeline.GitPullRequestEvent_OPEN,
	},
	FilePathsExcludes: []*string{
		jsii.String("filePathsExcludes"),
	},
	FilePathsIncludes: []*string{
		jsii.String("filePathsIncludes"),
	},
}
```

## Properties

- `branchesExcludes`: string[] — The list of patterns of Git branches that, when pull request events occurs, are to be excluded from starting the pipeline.

  **Default:** no branches.

  You can filter with glob patterns. The `branchesExcludes` takes priority
  over the `branchesIncludes`.

  Maximum length of this array is 8.

- `branchesIncludes`: string[] — The list of patterns of Git branches that, when pull request events occurs, are to be included as criteria that starts the pipeline.

  **Default:** no branches.

  You can filter with glob patterns. The `branchesExcludes` takes priority
  over the `branchesIncludes`.

  Maximum length of this array is 8.

- `events`: [GitPullRequestEvent](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.GitPullRequestEvent.html)[] — The field that specifies which pull request events to filter on (opened, updated, closed) for the trigger configuration.

  **Default:** all events.

- `filePathsExcludes`: string[] — The list of patterns of Git repository file paths that, when pull request events occurs, are to be excluded from starting the pipeline.

  **Default:** no filePaths.

  You can filter with glob patterns. The `filePathsExcludes` takes priority
  over the `filePathsIncludes`.

  Maximum length of this array is 8.

- `filePathsIncludes`: string[] — The list of patterns of Git repository file paths that, when pull request events occurs, are to be included as criteria that starts the pipeline.

  **Default:** no filePaths.

  You can filter with glob patterns. The `filePathsExcludes` takes priority
  over the `filePathsIncludes`.

  Maximum length of this array is 8.
