diff --git a/buildkite/resource_pipeline.go b/buildkite/resource_pipeline.go index fd84b2fd..84704725 100644 --- a/buildkite/resource_pipeline.go +++ b/buildkite/resource_pipeline.go @@ -217,6 +217,16 @@ func resourcePipeline() *schema.Resource { Optional: true, Type: schema.TypeBool, }, + "filter_enabled": { + Computed: true, + Optional: true, + Type: schema.TypeBool, + }, + "filter_condition": { + Computed: true, + Optional: true, + Type: schema.TypeString, + }, "publish_commit_status": { Computed: true, Optional: true, @@ -438,6 +448,8 @@ type PipelineExtraInfo struct { BuildBranches bool `json:"build_branches"` BuildTags bool `json:"build_tags"` CancelDeletedBranchBuilds bool `json:"cancel_deleted_branch_builds"` + FilterEnabled bool `json:"filter_enabled"` + FilterCondition string `json:"filter_condition"` PublishCommitStatus bool `json:"publish_commit_status"` PublishBlockedAsPending bool `json:"publish_blocked_as_pending"` PublishCommitStatusPerStep bool `json:"publish_commit_status_per_step"` @@ -679,6 +691,8 @@ func updatePipelineResourceExtraInfo(d *schema.ResourceData, pipeline *PipelineE "skip_pull_request_builds_for_existing_commits": s.SkipPullRequestBuildsForExistingCommits, "build_pull_request_ready_for_review": s.BuildPullRequestReadyForReview, "build_pull_request_forks": s.BuildPullRequestForks, + "filter_enabled": s.FilterEnabled, + "filter_condition": s.FilterCondition, "prefix_pull_request_fork_branch_names": s.PrefixPullRequestForkBranchNames, "build_branches": s.BuildBranches, "build_tags": s.BuildTags, diff --git a/buildkite/resource_pipeline_test.go b/buildkite/resource_pipeline_test.go index 34b72a53..c5717e25 100644 --- a/buildkite/resource_pipeline_test.go +++ b/buildkite/resource_pipeline_test.go @@ -68,6 +68,8 @@ func TestAccPipeline_add_remove_complex(t *testing.T) { resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.build_pull_requests", "false"), resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.build_tags", "true"), resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.cancel_deleted_branch_builds", "true"), + resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.filter_enabled", "true"), + resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.filter_condition", "build.pull_request.id == 123"), resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.prefix_pull_request_fork_branch_names", "true"), resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.publish_blocked_as_pending", "true"), resource.TestCheckResourceAttr("buildkite_pipeline.foobar", "provider_settings.0.publish_commit_status", "true"), @@ -328,6 +330,8 @@ func testAccPipelineConfigComplex(name string, steps string) string { build_pull_requests = false build_tags = true cancel_deleted_branch_builds = true + filter_enabled = true + filter_condition = "build.pull_request.id == 123" prefix_pull_request_fork_branch_names = true publish_blocked_as_pending = true publish_commit_status = true