Skip to content

Commit

Permalink
Update branch protection count logic to include repository creation c…
Browse files Browse the repository at this point in the history
…ondition
  • Loading branch information
Dave Arnold committed Feb 19, 2025
1 parent 42d38a7 commit 29b7b1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion github_branch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ locals {

# https://registry.terraform.io/providers/integrations/github/latest/docs/resources/branch_protection
resource "github_branch_protection" "main" {
count = (var.enforce_prs && !var.github_is_private) || var.github_is_private ? 1 : 0
count = var.create_repo && (var.enforce_prs && !var.github_is_private) || var.github_is_private ? 1 : 0

repository_id = local.github_repo.node_id
pattern = var.github_default_branch
Expand Down

0 comments on commit 29b7b1b

Please sign in to comment.