File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,5 @@ override.tf.json
2121
2222# Ignore any file with tfplan in it
2323* tfplan *
24+
25+ * terraform.lock *
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
22 required_providers {
33 github = {
44 source = " integrations/github"
5- version = " >=4.13 .0"
5+ version = " 4.18 .0"
66 }
77 }
88}
@@ -16,14 +16,24 @@ resource "github_team" "team" {
1616
1717resource "github_team_membership" "members" {
1818 for_each = toset (var. members )
19+
1920 team_id = github_team. team . id
2021 username = each. key
2122 role = " member"
2223}
2324
2425resource "github_team_membership" "maintainers" {
2526 for_each = toset (var. maintainers )
27+
2628 team_id = github_team. team . id
2729 username = each. key
2830 role = " maintainer"
2931}
32+
33+ resource "github_team_repository" "repos" {
34+ for_each = { for r in var . repositories : r . name => r }
35+
36+ team_id = github_team. team . id
37+ repository = each. key
38+ permission = each. value . permission
39+ }
Original file line number Diff line number Diff line change 11output "id" {
22 value = github_team. team . id
3- description = " The "
3+ description = " The GitHub team Id. "
44}
Original file line number Diff line number Diff line change @@ -27,3 +27,11 @@ variable "maintainers" {
2727 description = " Maintainers of the team."
2828 default = []
2929}
30+ variable "repositories" {
31+ type = list (object ({
32+ name = string
33+ permission = string
34+ }))
35+ description = " A list of repositories associated with the team and the what access the members should have."
36+ default = []
37+ }
You can’t perform that action at this time.
0 commit comments