-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Homebrew/feat/github/creat_all_teams
feat: add all teams as an import
- Loading branch information
Showing
12 changed files
with
118 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
locals { | ||
teams = concat( | ||
[for team in keys(var.teams) : team if !contains(["bots", "taps"], team)], | ||
keys(tomap(var.teams.maintainers)), | ||
keys(tomap(var.teams.taps)) | ||
) | ||
} | ||
|
||
resource "github_team" "main" { | ||
name = each.key | ||
privacy = "closed" | ||
|
||
for_each = { for team in keys(var.teams) : team => team if !contains(["bots", "taps"], team) } | ||
|
||
lifecycle { | ||
ignore_changes = [description] | ||
} | ||
} | ||
|
||
resource "github_team" "maintainers" { | ||
name = replace(each.key, "_", ".") | ||
privacy = "closed" | ||
parent_team_id = github_team.main["maintainers"].id | ||
|
||
for_each = { for team in keys(var.teams.maintainers) : team => team } | ||
|
||
lifecycle { | ||
ignore_changes = [description] | ||
} | ||
} | ||
|
||
resource "github_team" "taps" { | ||
name = replace(each.key, "_", ".") | ||
privacy = "closed" | ||
|
||
for_each = { for team in keys(var.teams.taps) : team => team } | ||
|
||
lifecycle { | ||
ignore_changes = [description] | ||
} | ||
} | ||
|
||
resource "github_team_membership" "ops_membership" { | ||
for_each = toset(var.teams.maintainers.ops) | ||
team_id = github_team.maintainers["ops"].id | ||
username = each.key | ||
role = contains(var.admins, each.key) ? "maintainer" : "member" | ||
} | ||
|
||
resource "github_team_membership" "plc_membership" { | ||
for_each = toset(var.teams.plc) | ||
team_id = github_team.main["plc"].id | ||
username = each.key | ||
role = contains(var.admins, each.key) ? "maintainer" : "member" | ||
} | ||
|
||
resource "github_team_membership" "tsc_membership" { | ||
for_each = toset(var.teams.maintainers.tsc) | ||
team_id = github_team.maintainers["tsc"].id | ||
username = each.key | ||
role = contains(var.admins, each.key) ? "maintainer" : "member" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters