Skip to content

Commit 8754dc2

Browse files
authored
feat: configure squash merge and disable force pushes (#2)
1 parent 74ff224 commit 8754dc2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

gh-protections.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ resource "github_branch_protection" "protections" {
1111
repository_id = github_repository.repositories[each.key].node_id
1212
pattern = "main"
1313
enforce_admins = false
14-
allows_force_pushes = true
14+
allows_force_pushes = false
1515
required_linear_history = true
1616
require_conversation_resolution = true
1717
required_status_checks {

gh-repositories.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ import {
77
*/
88

99
resource "github_repository" "repositories" {
10-
for_each = local.github_repositories
11-
name = each.key
12-
visibility = var.github_visibility
10+
for_each = local.github_repositories
11+
name = each.key
12+
visibility = var.github_visibility
13+
allow_squash_merge = true
14+
allow_merge_commit = true
15+
allow_rebase_merge = false
16+
delete_branch_on_merge = true
17+
squash_merge_commit_title = "PR_TITLE"
18+
squash_merge_commit_message = "PR_BODY"
1319
lifecycle {
1420
ignore_changes = [
1521
description,

0 commit comments

Comments
 (0)