diff --git a/gh-protections.tf b/gh-protections.tf index 3bdc160..34c3613 100644 --- a/gh-protections.tf +++ b/gh-protections.tf @@ -11,7 +11,7 @@ resource "github_branch_protection" "protections" { repository_id = github_repository.repositories[each.key].node_id pattern = "main" enforce_admins = false - allows_force_pushes = true + allows_force_pushes = false required_linear_history = true require_conversation_resolution = true required_status_checks { @@ -23,7 +23,7 @@ resource "github_branch_protection" "protections" { dismiss_stale_reviews = true pull_request_bypassers = ["/${github_team.admins.slug}"] require_code_owner_reviews = true - required_approving_review_count = 1 + required_approving_review_count = 0 require_last_push_approval = true restrict_dismissals = true } diff --git a/gh-repositories.tf b/gh-repositories.tf index 06c83aa..bac3325 100644 --- a/gh-repositories.tf +++ b/gh-repositories.tf @@ -7,9 +7,15 @@ import { */ resource "github_repository" "repositories" { - for_each = local.github_repositories - name = each.key - visibility = var.github_visibility + for_each = local.github_repositories + name = each.key + visibility = var.github_visibility + allow_squash_merge = true + allow_merge_commit = true + allow_rebase_merge = false + delete_branch_on_merge = true + squash_merge_commit_title = "PR_TITLE" + squash_merge_commit_message = "PR_BODY" lifecycle { ignore_changes = [ description,