# GitPushFilter

Git push 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#L8)
- Type last changed: v2.186.0 · 27 Mar 2025

## 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 gitPushFilter: codepipeline.GitPushFilter = {
  branchesExcludes: ['branchesExcludes'],
  branchesIncludes: ['branchesIncludes'],
  filePathsExcludes: ['filePathsExcludes'],
  filePathsIncludes: ['filePathsIncludes'],
  tagsExcludes: ['tagsExcludes'],
  tagsIncludes: ['tagsIncludes'],
};
```

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_push_filter = codepipeline.GitPushFilter(
    branches_excludes=["branchesExcludes"],
    branches_includes=["branchesIncludes"],
    file_paths_excludes=["filePathsExcludes"],
    file_paths_includes=["filePathsIncludes"],
    tags_excludes=["tagsExcludes"],
    tags_includes=["tagsIncludes"]
)
```

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.*;

GitPushFilter gitPushFilter = GitPushFilter.builder()
        .branchesExcludes(List.of("branchesExcludes"))
        .branchesIncludes(List.of("branchesIncludes"))
        .filePathsExcludes(List.of("filePathsExcludes"))
        .filePathsIncludes(List.of("filePathsIncludes"))
        .tagsExcludes(List.of("tagsExcludes"))
        .tagsIncludes(List.of("tagsIncludes"))
        .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 gitPushFilter = new GitPushFilter {
    BranchesExcludes = new [] { "branchesExcludes" },
    BranchesIncludes = new [] { "branchesIncludes" },
    FilePathsExcludes = new [] { "filePathsExcludes" },
    FilePathsIncludes = new [] { "filePathsIncludes" },
    TagsExcludes = new [] { "tagsExcludes" },
    TagsIncludes = new [] { "tagsIncludes" }
};
```

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"

gitPushFilter := &GitPushFilter{
	BranchesExcludes: []*string{
		jsii.String("branchesExcludes"),
	},
	BranchesIncludes: []*string{
		jsii.String("branchesIncludes"),
	},
	FilePathsExcludes: []*string{
		jsii.String("filePathsExcludes"),
	},
	FilePathsIncludes: []*string{
		jsii.String("filePathsIncludes"),
	},
	TagsExcludes: []*string{
		jsii.String("tagsExcludes"),
	},
	TagsIncludes: []*string{
		jsii.String("tagsIncludes"),
	},
}
```

## 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.

- `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.

- `tagsExcludes`: string[] — The list of patterns of Git tags that, when pushed, are to be excluded from starting the pipeline.

  **Default:** no tags.

  You can filter with glob patterns. The `tagsExcludes` takes priority
  over the `tagsIncludes`.

  Maximum length of this array is 8.

- `tagsIncludes`: string[] — The list of patterns of Git tags that, when pushed, are to be included as criteria that starts the pipeline.

  **Default:** no tags.

  You can filter with glob patterns. The `tagsExcludes` takes priority
  over the `tagsIncludes`.

  Maximum length of this array is 8.
