-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.tf
More file actions
143 lines (134 loc) · 4.94 KB
/
variables.tf
File metadata and controls
143 lines (134 loc) · 4.94 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
variable "name" {
type = string
description = "The name of the ruleset."
}
variable "bypass_actors" {
type = object({
repository_roles = optional(list(object({
role_id = string
always_bypass = optional(bool)
})))
teams = optional(list(object({
team_id = string
always_bypass = optional(bool)
})))
integrations = optional(list(object({
installation_id = number
always_bypass = optional(bool)
})))
organization_admin = optional(object({
always_bypass = optional(bool)
}))
})
default = {}
description = "An object containing fields for role, team, organization admin, and integration bypass actors. Defaults to `{}`"
}
variable "rules" {
type = object({
branch_name_pattern = optional(object({
operator = string
pattern = string
name = optional(string)
negate = optional(bool)
}))
tag_name_pattern = optional(object({
operator = string
pattern = string
name = optional(string)
negate = optional(bool)
}))
commit_author_email_pattern = optional(object({
operator = string
pattern = string
name = optional(string)
negate = optional(bool)
}))
commit_message_pattern = optional(object({
operator = string
pattern = string
name = optional(string)
negate = optional(bool)
}))
committer_email_pattern = optional(object({
operator = string
pattern = string
name = optional(string)
negate = optional(bool)
}))
creation = optional(bool)
deletion = optional(bool)
update = optional(bool)
non_fast_forward = optional(bool)
required_linear_history = optional(bool)
required_signatures = optional(bool)
update_allows_fetch_and_merge = optional(bool)
pull_request = optional(object({
dismiss_stale_reviews_on_push = optional(bool)
require_code_owner_review = optional(bool)
require_last_push_approval = optional(bool)
required_approving_review_count = optional(number)
required_review_thread_resolution = optional(bool)
}))
required_status_checks = optional(object({
required_check = list(object({
context = string
integration_id = optional(number)
}))
strict_required_status_check_policy = optional(bool)
}))
required_workflows = optional(object({
required_workflows = list(object({
repository_id = number
path = string
ref = optional(string)
}))
}))
required_deployment_environments = optional(list(string))
})
description = "An object containing fields for all the rule definitions the ruleset should enforce."
}
variable "ref_name_inclusions" {
type = list(string)
description = "A list of ref names or patterns to include. Defaults to an empty list. If set and `ruleset_type` is set to `organization` then either `repository_name_inclusions` or `repository_name_exclusions` must be set to a list of atleast 1 string."
default = []
}
variable "ref_name_exclusions" {
type = list(string)
description = "A list of ref names or patterns to exclude. Defaults to an empty list. If set and `ruleset_type` is set to `organization` then either `repository_name_inclusions` or `repository_name_exclusions` must be set to a list of atleast 1 string."
default = []
}
variable "repository_name_inclusions" {
type = list(string)
description = "A list of repository names or patterns to include. If `ruleset_type` is set to `repository` then this field is ignored."
default = []
}
variable "repository_name_exclusions" {
type = list(string)
description = "A list of repository names or patterns to exclude. If `ruleset_type` is set to `repository` then this field is ignored."
default = []
}
variable "target" {
type = string
description = "The target of the ruleset. Should be one of either `branch` or `tag`."
validation {
condition = can(regex("branch|tag", var.target))
error_message = "The target must be either `branch` or `tag`."
}
}
variable "ruleset_type" {
type = string
description = "The type of rulset to make. Should be one of ether `organization` or `repository`."
validation {
condition = can(regex("organization|repository", var.ruleset_type))
error_message = "The ruleset type must be either `organization` or `repository`."
}
}
variable "enforcement" {
type = string
description = "The enforcement level of the ruleset. Should be one of either `active`, `evaluate` or `disabled`. Defaults to `active`"
default = "active"
validation {
condition = can(regex("active|evaluate|disabled", var.enforcement))
error_message = "The enforcement level must be either `active`, `evaluate` or `disabled`."
}
}