Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Members and Admins #53

Open
unique-dominik opened this issue Jan 25, 2023 · 1 comment
Open

Members and Admins #53

unique-dominik opened this issue Jan 25, 2023 · 1 comment

Comments

@unique-dominik
Copy link

Issue

admins = {
  "admin"   = "admin"
}

team_a = {
  "admin" = "admin"
}

merge(
  local.team_a,
  ...
)

Question

Sorry to bother, I see you actually have like no issues but I am stuck (in my head I assume). How am I supposed to model that an admin is also a member? Or shall I just let GH handle membership?
If I appoint an admin as member, his member state always wins. Maybe I am just blind. But the teams we then need in the repo module of yours to assign push permissions.

What am I understanding wrong?

@samuelb
Copy link

samuelb commented Feb 29, 2024

We solved it like this:

locals {
  admins = ["peter", "mary"]
  teams = {
    ops = {
      members = ["peter", "paul"]
      # [...]
    }
    devs = {
      members = ["mary", "mike"]
      # [...]
    }
  }
}

module "organization" {
  source  = "mineiros-io/organization/github"
  admins  = local.admins
  members = setsubtract(flatten(local.teams[*].members), local.admins) # admins can't be regular members
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants