Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions terraform/github/branches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ resource "github_branch_protection" "kayobe_branch_protection_caracal" {
required_pull_request_reviews {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 1
required_approving_review_count = 2
}
Comment on lines 181 to 185

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This required_pull_request_reviews block, along with most of the surrounding resource block, is duplicated for the caracal, epoxy, and master branch protection rules. This pattern of duplication is present throughout the file for other branch protection rules as well.

While a full refactoring is likely out of scope for this PR, consider consolidating these resources in the future. Using a single github_branch_protection resource with a for_each meta-argument over a map of branch configurations would significantly reduce code duplication. This would make the rules easier to manage and update consistently.


push_restrictions = [
Expand Down Expand Up @@ -215,7 +215,7 @@ resource "github_branch_protection" "kayobe_branch_protection_epoxy" {
required_pull_request_reviews {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 1
required_approving_review_count = 2
}

push_restrictions = [
Expand Down Expand Up @@ -251,7 +251,7 @@ resource "github_branch_protection" "kayobe_branch_protection_master" {
required_pull_request_reviews {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 1
required_approving_review_count = 2
}

push_restrictions = [
Expand Down