-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
127 lines (113 loc) · 3.21 KB
/
variables.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
variable "name" {
description = "The name of the repository"
type = string
}
variable "description" {
description = "Repository description"
type = string
default = ""
}
variable "required_approvals" {
description = "Number of approvals required before merging a pull request"
type = number
default = 1
}
variable "required_status_checks" {
description = "A list of status checks that must pass before a PR can merge"
type = list(string)
default = []
}
variable "visibility" {
description = "Repository visibility (public or private)"
type = string
default = "public"
validation {
error_message = "unknown visiblity: must be public or private"
condition = contains(["public", "private"], var.visibility)
}
}
variable "branch_protection" {
description = "Configure branch protection if true"
type = bool
default = true
}
variable "labels" {
description = "List of labels to configure on the repository"
type = list(object({
name = string
color = string
description = string
}))
default = null
}
variable "teams" {
description = "Teams with access to this repository"
type = list(object({
team_id = string
permission = string
}))
default = []
validation {
error_message = "unknown permission: permission must be one of pull, push, maintain, triage, or admin"
condition = alltrue([
for v in var.teams : contains(["pull", "push", "maintain", "triage", "admin"], v.permission)
])
}
}
variable "users" {
description = "Users with access to this repository"
type = list(object({
username = string
permission = string
}))
default = []
validation {
error_message = "unknown permission: permission must be one of pull, push, maintain, triage, or admin"
condition = alltrue([
for v in var.users : contains(["pull", "push", "maintain", "triage", "admin"], v.permission)
])
}
}
variable "is_template" {
description = "Set this to true if this is a template repository"
type = bool
default = false
}
variable "use_public_template" {
description = "Use the public_template repository as the template for a new repository"
type = bool
default = true
}
variable "vulnerability_alerts" {
description = "Enable or disable dependabot vulnerability alerts"
type = bool
default = false
}
variable "pages" {
description = "Configuration for github pages"
type = object({
source = optional(object({
branch = string
path = string
}))
build_type = optional(string, "legacy")
cname = optional(string)
})
default = null
validation {
error_message = "build_type must be one of \"workflow\" or \"legacy\""
condition = var.pages == null ? true : (
var.pages.build_type == null ||
contains(["legacy", "workflow"], var.pages.build_type)
)
}
}
variable "all_members_permission" {
description = "Permission for all organization members"
type = string
default = "triage"
validation {
error_message = "invalid permission name"
condition = contains(["pull", "push", "triage", "maintain", "admin"], var.all_members_permission)
}
}