scope GitHub App secret to the github unit, use team slugs
This commit is contained in:
@@ -75,21 +75,19 @@ resource "github_repository_collaborators" "this" {
|
||||
dynamic "team" {
|
||||
for_each = { for e, p in each.value : trimprefix(e, "@") => p if startswith(e, "@") }
|
||||
content {
|
||||
team_id = team.key
|
||||
team_id = github_team.this[team.key].slug
|
||||
permission = team.value
|
||||
}
|
||||
}
|
||||
|
||||
depends_on = [github_team.this]
|
||||
}
|
||||
|
||||
resource "github_repository_file" "codeowners" {
|
||||
for_each = { for name, r in var.repository : name => r if length(r.maintainers) > 0 }
|
||||
for_each = { for name, r in var.repository : name => r if length(r.maintainers) > 0 && r.auto_init }
|
||||
|
||||
repository = github_repository.this[each.key].name
|
||||
branch = github_branch_default.this[each.key].branch
|
||||
file = ".github/CODEOWNERS"
|
||||
content = "* ${join(" ", [for e in each.value.maintainers : startswith(e, "@") ? "@${var.owner}/${trimprefix(e, "@")}" : "@${e}"])}\n"
|
||||
content = "* ${join(" ", [for e in each.value.maintainers : startswith(e, "@") ? "@${var.owner}/${github_team.this[trimprefix(e, "@")].slug}" : "@${e}"])}\n"
|
||||
commit_message = "add initial CODEOWNERS"
|
||||
overwrite_on_create = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user