-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrontendteam.tf
54 lines (40 loc) · 1.04 KB
/
frontendteam.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
# Someone Elses Contributors GitHub Team
locals {
frontenders = [
"Linsmed", "oriafo" #github username
]
fe_repositories = [
"frontend-app", "frontend-react"
]
}
# Create a contributors team
resource "github_team" "frontend" {
name = "frontend"
description = "frontend contributors GitHub Team"
privacy = "closed"
}
# Add contributors team as orgnisation member
resource "github_membership" "frontend" {
for_each = toset(local.frontenders)
username = each.value
role = "member"
}
# Add contributors to github team
resource "github_team_members" "frontenders" {
for_each = toset(local.frontenders)
team_id = github_team.frontend.id
members {
username = each.value
role = "member"
}
}
# Set permissions to respositories for frontenders github team
resource "github_team_repository" "frontenders" {
for_each = toset(local.fe_repositories)
team_id = github_team.frontend.id
repository = each.value
permission = "push"
depends_on = [
github_repository.respositories
]
}