terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

The create API can also be used to modify the role

Open csainty opened this issue 3 years ago • 0 comments

Reading the docs further on this action, the create endpoint can also be used for updating role.

If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.

I made an earlier edit here - https://github.com/integrations/terraform-provider-github/pull/1216 - which works, we're no longer removing access, but the delete/create results in the user being sent two emails informing them they have been removed and added again.

The reason I get caught up on this isn't that I change membership a lot, but when a user gets Org-level Admin rights then the APIs start returning that they are a maintainer of the team, causing terraform to attempt to update them, triggering the emails. We generally run without human admin accounts, bumping people up and down when needed, so there is noise generated by the code as it exists now.

csainty avatar Sep 06 '22 05:09 csainty