Skip to content

Commit

Permalink
add github_branch_protection for next-*
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Jan 22, 2024
1 parent 889f411 commit 1a55055
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions terraform/modules/github_repository/branch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,24 @@ resource "github_branch_protection" "main" {
required_approving_review_count = 0
}
}


resource "github_branch_protection" "next-release" {
# Branch protection can only be enabled on private repositories if using a
# paid GitHub plan
count = var.visibility == "public" ? 1 : 0

repository_id = github_repository.repository.node_id
pattern = "next-*"
enforce_admins = true
required_linear_history = false

required_status_checks {
strict = true
contexts = null
}

required_pull_request_reviews {
required_approving_review_count = 0
}
}

0 comments on commit 1a55055

Please sign in to comment.