-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
93 lines (77 loc) · 2 KB
/
main.tf
File metadata and controls
93 lines (77 loc) · 2 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
terraform {
required_providers {
github = {
source = "integrations/github"
version = "6.11.1"
}
gitlab = {
source = "gitlabhq/gitlab"
version = "18.9.0"
}
}
}
data "github_repositories" "repositories" {
query = "org:code0-tech"
}
data "github_repositories" "public_repositories" {
query = "org:code0-tech visibility:public"
}
data "github_repositories" "private_repositories" {
query = "org:code0-tech visibility:private"
}
module "global_labels" {
source = "../../modules/github/global_labels"
for_each = toset(data.github_repositories.repositories.names)
repository = each.value
}
module "release_tools_configs" {
source = "../../modules/github/release_tools_configs"
}
data "gitlab_project_variable" "github_public_discord_webhook_url" {
project = "code0-tech/secret-manager"
key = "GITHUB_PUBLIC_DISCORD_WEBHOOK_URL"
}
data "gitlab_project_variable" "github_private_discord_webhook_url" {
project = "code0-tech/secret-manager"
key = "GITHUB_PRIVATE_DISCORD_WEBHOOK_URL"
}
resource "github_repository_webhook" "public_discord_webhook" {
for_each = toset(data.github_repositories.public_repositories.names)
repository = each.value
events = [
"discussion",
"fork",
"issues",
"pull_request",
"pull_request_review",
"push",
"release",
"star",
"watch"
]
configuration {
//noinspection HILUnresolvedReference
url = data.gitlab_project_variable.github_public_discord_webhook_url.value
content_type = "json"
}
}
resource "github_repository_webhook" "private_discord_webhook" {
for_each = toset(data.github_repositories.private_repositories.names)
repository = each.value
events = [
"discussion",
"fork",
"issues",
"pull_request",
"pull_request_review",
"push",
"release",
"star",
"watch"
]
configuration {
//noinspection HILUnresolvedReference
url = data.gitlab_project_variable.github_private_discord_webhook_url.value
content_type = "json"
}
}