-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh-protections.tf
More file actions
36 lines (35 loc) · 1.15 KB
/
gh-protections.tf
File metadata and controls
36 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
import {
for_each = local.github_repositories
to = github_branch_protection.protections[each.key]
id = "${each.key}:main"
}
*/
resource "github_branch_protection" "protections" {
for_each = local.github_repositories
repository_id = github_repository.repositories[each.key].node_id
pattern = "main"
enforce_admins = false
allows_force_pushes = false
required_linear_history = true
require_conversation_resolution = true
required_status_checks {
strict = true
contexts = []
}
required_pull_request_reviews {
dismissal_restrictions = ["/${github_team.admins.slug}"]
dismiss_stale_reviews = true
pull_request_bypassers = ["/${github_team.admins.slug}"]
require_code_owner_reviews = true
required_approving_review_count = 0
require_last_push_approval = true
restrict_dismissals = true
}
restrict_pushes {
push_allowances = [
"/${github_team.admins.slug}"
]
}
depends_on = [github_repository.repositories, github_team.admins]
}