-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
103 lines (97 loc) · 3.26 KB
/
variables.tf
File metadata and controls
103 lines (97 loc) · 3.26 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
variable "github_owner" {
description = "GitHub username that owns the repositories"
type = string
}
variable "github_repositories" {
description = "GitHub repositories to manage"
type = map(object({
description = optional(string)
homepage = optional(string)
topics = optional(list(string), [])
visibility = optional(string, "public")
enable_issues = optional(bool, true)
enable_projects = optional(bool, false)
enable_wiki = optional(bool, false)
enable_merge_commit = optional(bool, false)
enable_rebase_merge = optional(bool, false)
enable_squash_merge = optional(bool, true)
enable_update_branch = optional(bool, true)
squash_merge_commit_title = optional(string, "COMMIT_OR_PR_TITLE")
squash_merge_commit_message = optional(string, "COMMIT_MESSAGES")
delete_branch_on_merge = optional(bool, true)
}))
validation {
condition = alltrue([
for repo in values(var.github_repositories) :
repo.visibility == null || contains(["public", "private", "internal"], repo.visibility)
])
error_message = "visibility must be one of: 'public', 'private', 'internal'."
}
validation {
condition = alltrue([
for repo in values(var.github_repositories) :
repo.squash_merge_commit_title == null || contains(["COMMIT_OR_PR_TITLE", "PR_TITLE"], repo.squash_merge_commit_title)
])
error_message = "squash_merge_commit_title must be one of: 'COMMIT_OR_PR_TITLE', 'PR_TITLE'."
}
validation {
condition = alltrue([
for repo in values(var.github_repositories) :
repo.squash_merge_commit_message == null || contains(["BLANK", "COMMIT_MESSAGES", "PR_BODY"], repo.squash_merge_commit_message)
])
error_message = "squash_merge_commit_message must be one of: 'BLANK', 'COMMIT_MESSAGES', 'PR_BODY'."
}
}
variable "github_issue_labels" {
description = "Issue labels to manage on every repository, keyed by name"
type = map(object({
color = string
description = optional(string)
}))
default = {
"bug" = {
color = "d73a4a"
description = "Something isn't working"
}
"documentation" = {
color = "0075ca"
description = "Improvements or additions to documentation"
}
"duplicate" = {
color = "cfd3d7"
description = "This issue or pull request already exists"
}
"enhancement" = {
color = "a2eeef"
description = "New feature or request"
}
"help-wanted" = {
color = "008672"
description = "Extra attention is needed"
}
"inactive" = {
color = "cfd3d7"
description = "Hasn't had activity in 60 days"
}
"invalid" = {
color = "e4e669"
description = "This doesn't seem right"
}
"need-more-info" = {
color = "d876e3"
description = "Further information is requested"
}
"pinned" = {
color = "f9348a"
description = "Will not be marked with the inactive label"
}
"question" = {
color = "d4c5f9"
description = "A question or general inquiry"
}
"wontfix" = {
color = "ffffff"
description = "This will not be worked on"
}
}
}