From e03740b5356c3729cf142a15909cf0260db6d646 Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Tue, 18 Feb 2025 21:07:17 -0800 Subject: [PATCH] Add dependencies for branch and branch protection resources --- github_branch.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/github_branch.tf b/github_branch.tf index 6a42a23..70c1b46 100644 --- a/github_branch.tf +++ b/github_branch.tf @@ -8,6 +8,9 @@ resource "github_branch" "branch" { count = var.github_default_branch == "main" ? 0 : 1 repository = local.github_repo.name branch = var.github_default_branch + depends_on = [ + github_repository.repo + ] } @@ -69,4 +72,8 @@ resource "github_branch_protection" "main" { required_status_checks[0].contexts ] } + + depends_on = [ + github_branch_default.default_main_branch + ] }