-
Notifications
You must be signed in to change notification settings - Fork 3
/
repositories.tf
78 lines (65 loc) · 2.16 KB
/
repositories.tf
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
locals {
# default settings for private repositories
private_defaults = {
private = true
has_issues = true
allow_merge_commit = true
topics = [
"iac",
"terraform",
"terraform-modules",
]
}
# default settings for public repositories ( merge with private default settings )
public_defaults = merge(local.private_defaults, {
private = false
license_template = "apache-2.0"
})
default_branch_protections = [
{
branch = "master"
enforce_admins = false
required_status_checks = {
strict = true
}
required_pull_request_reviews = {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = length(module.team_reviewers.team_memberships)
dismissal_teams = [module.team_contributors.slug]
}
}
]
}
module "public_repository" {
source = "mineiros-io/repository/github"
version = "0.1.0"
name = "public-repository"
homepage_url = "https://medium.com/mineiros"
description = "A test repository create for demonstration purpose for the How to manage your GitHub Organization with Terraform article."
defaults = local.public_defaults
branch_protections = local.default_branch_protections
license_template = "apache-2.0"
gitignore_template = "Terraform"
push_team_ids = [module.team_contributors.id]
extra_topics = [
"integrationtest",
"terraform"
]
}
module "private_repository" {
source = "mineiros-io/repository/github"
version = "0.1.0"
name = "terraform-aws-cloudfront"
homepage_url = "https://medium.com/mineiros"
description = "A test repository create for demonstration purpose for the How to manage your GitHub Organization with Terraform article."
defaults = local.private_defaults
branch_protections = local.default_branch_protections
license_template = "apache-2.0"
gitignore_template = "Terraform"
push_team_ids = [module.team_contributors.id]
extra_topics = [
"anothertestrepository",
"terraform"
]
}