From 667e9014644163e1c251afb504d49e20e529b78e Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Fri, 10 Apr 2026 21:27:00 -0700 Subject: [PATCH 1/2] feat: support for copilot_code_review --- main.tf | 8 ++++++++ variables.tf | 4 ++++ versions.tf | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 14a135e..5123304 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" } } } From c7b1d06e61a3daab5a3c1f372562943d7e4b383e Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Mon, 13 Apr 2026 22:01:00 -0400 Subject: [PATCH 2/2] fix(tf): terratest --- examples/complete/fixtures.us-east-2.tfvars | 2 +- examples/complete/variables.tf | 4 ++++ examples/complete/versions.tf | 2 +- examples/minimum/variables.tf | 4 ++++ examples/minimum/versions.tf | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) 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" } } }