diff --git a/github_files.tf b/github_files.tf index 07ae2a9..a1ef4d1 100644 --- a/github_files.tf +++ b/github_files.tf @@ -1,5 +1,6 @@ # https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_file resource "github_repository_file" "codeowners" { + count = var.create_codeowners ? 1 : 0 repository = github_repository.repo.name branch = var.github_default_branch file = "CODEOWNERS" @@ -26,4 +27,4 @@ resource "github_repository_file" "extra_files" { branch ] } -} \ No newline at end of file +} diff --git a/variables.tf b/variables.tf index 89234e1..ab97845 100644 --- a/variables.tf +++ b/variables.tf @@ -152,3 +152,7 @@ variable "pull_request_bypassers" { type = list(any) } +variable create_codeowners { + default = true + type = bool +}