-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
36 lines (27 loc) · 726 Bytes
/
main.tf
File metadata and controls
36 lines (27 loc) · 726 Bytes
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
locals {
is_organization = contains(var.repositories, "*")
repositories = local.is_organization ? [] : var.repositories
}
resource "github_organization_webhook" "this" {
count = local.is_organization ? 1 : 0
events = var.events
active = var.enabled
configuration {
url = var.url
content_type = lower(var.content_type)
insecure_ssl = !var.ssl_enabled
secret = var.secret
}
}
resource "github_repository_webhook" "this" {
for_each = local.repositories
repository = each.key
events = var.events
active = var.enabled
configuration {
url = var.url
content_type = lower(var.content_type)
insecure_ssl = !var.ssl_enabled
secret = var.secret
}
}