-
Notifications
You must be signed in to change notification settings - Fork 948
Feature request: Provide membership status in the github_membership data source. #862
Description
Hi there! This is a feature request.
Currently, the github_membership data source considers Github users with unaccepted invitations to join an organization to be full organization members. It would be helpful to be able to distinguish, when using github_membership, whether a user is a current organization member, or merely has a pending invitation. This information would be useful, for example, to ensure that only current organization members are added to a team via the github_team_membership resource or given certain repository protected branch permissions via the github_branch_protection resource.
Glancing at the code, implementing this feature might be as simple as getting the state field of the go-github client's Membership object when calling the go-github GetOrgMembership method in github/data_source_github_membership.go, and adding a "state" property to the github_membership schema. go-github's Membership's state value should be pending if the user has an unaccepted invitation, or active if the user has successfully accepted the invitation.