Commit 8de6539 1 parent cc9b8d0 commit 8de6539 Copy full SHA for 8de6539
File tree 7 files changed +24
-28
lines changed
7 files changed +24
-28
lines changed Original file line number Diff line number Diff line change 6
6
- main
7
7
paths :
8
8
- ' terraform/production/*.tfvars'
9
+ - ' terraform/*.tf'
9
10
10
11
concurrency :
11
12
group : terraform-actions
Original file line number Diff line number Diff line change 5
5
- main
6
6
paths :
7
7
- ' terraform/production/*.tfvars'
8
+ - ' terraform/*.tf'
8
9
9
10
concurrency :
10
11
group : terraform-actions
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ All changes should be made in `production/*.tfvars`:
51
51
topics = []
52
52
visibility = "public" # optional, default is "public"
53
53
is_django_commons_repo = optional(bool, false) # Do not create teams for repository
54
- enable_branch_protection = true # optional, default is true
55
54
required_status_checks_contexts = [] # optional, default is []
56
55
admins = [] # Members of the repository's admin and repository teams. Have admin permissions
57
56
committers = [] # Members of the repository's committers and repository teams. Have write permissions
Original file line number Diff line number Diff line change 3
3
4
4
locals {
5
5
6
- admins = {
7
- for user in var . admins : user => " admin"
8
- }
9
-
10
- branch_protections = {
11
- for repository_key , repository in var . repositories : repository_key => repository
12
- if repository . enable_branch_protection
13
- }
14
-
15
- members = {
16
- for user in var . members : user => " member"
17
- }
18
-
19
- users = merge (local. admins , local. members )
20
-
21
6
project_repositories = {
22
7
for repository_key , repository in var . repositories : repository_key => repository
23
8
if ! repository . is_django_commons_repo
Original file line number Diff line number Diff line change 2
2
repositories = {
3
3
4
4
" .github" = {
5
- description = " A Special Repository."
6
- enable_branch_protection = false
5
+ description = " A Special Repository."
7
6
8
7
topics = []
9
8
push_allowances = []
10
9
is_django_commons_repo = true
11
10
}
12
11
13
12
" controls" = {
14
- description = " The controls for managing Django Commons projects"
15
- enable_branch_protection = false
16
- allow_merge_commit = true
17
- allow_rebase_merge = true
18
- allow_squash_merge = true
19
- topics = []
20
- push_allowances = []
21
- is_django_commons_repo = true
13
+ description = " The controls for managing Django Commons projects"
14
+ allow_merge_commit = true
15
+ allow_rebase_merge = true
16
+ allow_squash_merge = true
17
+ topics = []
18
+ push_allowances = []
19
+ is_django_commons_repo = true
22
20
}
23
21
24
22
" membership" = {
@@ -162,7 +160,6 @@ repositories = {
162
160
" tailwindcss" ,
163
161
]
164
162
visibility = " public"
165
- enable_branch_protection = true
166
163
required_status_checks_contexts = []
167
164
admins = [
168
165
" oliverandrich" ,
Original file line number Diff line number Diff line change 1
1
# GitHub Membership Resource
2
2
# https://registry.terraform.io/providers/integrations/github/latest/docs/resources/membership
3
+ data "github_users" "users" {
4
+ usernames = setunion (var. admins , var. members )
5
+ }
6
+
7
+ output "invalid_users" {
8
+ value = data. github_users . users . unknown_logins
9
+ }
10
+
11
+ locals {
12
+ users = merge (
13
+ { for user in var . admins : user => " admin" if contains (data. github_users . users . logins , user) },
14
+ { for user in var . members : user => " member" if contains (data. github_users . users . logins , user) }
15
+ )
16
+ }
3
17
4
18
resource "github_membership" "this" {
5
19
for_each = local. users
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ variable "repositories" {
33
33
homepage_url = optional (string , " " )
34
34
has_wiki = optional (bool , false )
35
35
push_allowances = optional (list (string ), [])
36
- enable_branch_protection = optional (bool , true )
37
36
required_status_checks_contexts = optional (list (string ), [])
38
37
is_template = optional (bool , false ) # Is the repository a template repository
39
38
topics = optional (list (string ))
You can’t perform that action at this time.
0 commit comments