Skip to content

Commit

Permalink
Remove prevent_destroy from branch protection rules
Browse files Browse the repository at this point in the history
Using prevent_destroy prevents moving repositories between teams.
Although branch protections are sensitive, we won't lose any data by
simply removing them.
  • Loading branch information
markgoddard committed Dec 20, 2023
1 parent adade3f commit 441742a
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions terraform/github/branches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ resource "github_branch_protection" "ansible_branch_protection" {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "batch_branch_protection" {
Expand All @@ -55,10 +51,6 @@ resource "github_branch_protection" "batch_branch_protection" {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
Expand Down Expand Up @@ -94,10 +86,6 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
}).default)
strict = false
}

lifecycle {
prevent_destroy = false
}
}

resource "github_branch_protection" "kayobe_branch_protection_py_3-10" {
Expand Down Expand Up @@ -129,10 +117,6 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-10" {
}).default)
strict = false
}

lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
Expand Down Expand Up @@ -168,9 +152,6 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
}).default)
strict = false
}
lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "openstack_branch_protection_py_3-10" {
Expand Down Expand Up @@ -202,10 +183,6 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-10" {
}).default)
strict = false
}

lifecycle {
prevent_destroy = false
}
}

resource "github_branch_protection" "platform_branch_protection" {
Expand All @@ -231,10 +208,6 @@ resource "github_branch_protection" "platform_branch_protection" {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "releasetrain_branch_protection" {
Expand All @@ -260,10 +233,6 @@ resource "github_branch_protection" "releasetrain_branch_protection" {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}

resource "github_branch_protection" "smslab_branch_protection" {
Expand All @@ -289,9 +258,5 @@ resource "github_branch_protection" "smslab_branch_protection" {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}

0 comments on commit 441742a

Please sign in to comment.