diff --git a/examples/complete/fixtures.us-east-2.tfvars b/examples/complete/fixtures.us-east-2.tfvars index a6388b1..226a666 100644 --- a/examples/complete/fixtures.us-east-2.tfvars +++ b/examples/complete/fixtures.us-east-2.tfvars @@ -192,7 +192,7 @@ rulesets = { required_linear_history = true required_signatures = false update = true - update_allows_fetch_and_merge = true + update_allows_fetch_and_merge = false pull_request = { dismiss_stale_reviews_on_push = true require_code_owner_review = true diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index f765678..fdbb940 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -511,6 +511,10 @@ variable "rulesets" { tool = string })) }), null), + copilot_code_review = optional(object({ + review_on_push = optional(bool, false) + review_draft_pull_requests = optional(bool, false) + }), null), // Push ruleset rules (only valid when target = "push") file_path_restriction = optional(object({ restricted_file_paths = list(string) diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 8065311..9eda1b6 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = ">= 6.9.0" + version = ">= 6.10.0" } } } diff --git a/examples/minimum/variables.tf b/examples/minimum/variables.tf index 1440455..7bbccd5 100644 --- a/examples/minimum/variables.tf +++ b/examples/minimum/variables.tf @@ -482,6 +482,10 @@ variable "rulesets" { # tool = string # })) # }), null), + copilot_code_review = optional(object({ + review_on_push = optional(bool, false) + review_draft_pull_requests = optional(bool, false) + }), null), }), })) default = {} diff --git a/examples/minimum/versions.tf b/examples/minimum/versions.tf index 0a931f5..9eda1b6 100644 --- a/examples/minimum/versions.tf +++ b/examples/minimum/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = ">= 6.6.0" + version = ">= 6.10.0" } } } diff --git a/main.tf b/main.tf index 1e3dc60..ffdc156 100644 --- a/main.tf +++ b/main.tf @@ -560,6 +560,14 @@ resource "github_repository_ruleset" "default" { } } + dynamic "copilot_code_review" { + for_each = rules.value.copilot_code_review != null ? [rules.value.copilot_code_review] : [] + content { + review_on_push = copilot_code_review.value.review_on_push + review_draft_pull_requests = copilot_code_review.value.review_draft_pull_requests + } + } + # Push ruleset rules (only valid when target = "push") dynamic "file_path_restriction" { for_each = rules.value.file_path_restriction != null ? [rules.value.file_path_restriction] : [] diff --git a/variables.tf b/variables.tf index ca7436e..b15c426 100644 --- a/variables.tf +++ b/variables.tf @@ -529,6 +529,10 @@ variable "rulesets" { tool = string })) }), null), + copilot_code_review = optional(object({ + review_on_push = optional(bool, false) + review_draft_pull_requests = optional(bool, false) + }), null), // Push ruleset rules (only valid when target = "push") file_path_restriction = optional(object({ restricted_file_paths = list(string) diff --git a/versions.tf b/versions.tf index 8065311..9eda1b6 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = ">= 6.9.0" + version = ">= 6.10.0" } } }