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

feat: closes #862 by adding a state attribute for the state of org membership

Open wwsean08 opened this issue 3 years ago • 0 comments

Description

Adds a new state field to the membership data object so that you can tell if a user has accepted an invite to the organization or it is still pending. This would resolve #862 by including the state information.

Testing

Manually tested against an organization I setup (wwsean08-terraform-test) where I as the owner was a member and another user was invited but hadn't accepted using the following terraform for a minimal test:

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 5.0"
    }
  }
}

provider "github" {
  owner = "wwsean08-terraform-test"
}

data "github_membership" "active" {
  username = "wwsean08"
}

data "github_membership" "pending" {
  username = "nealpsmith"
}

output "expected_active" {
  value = data.github_membership.active.state
}

output "expected_pending" {
  value = data.github_membership.pending.state
}

With that test I see the following output: Screen Shot 2022-09-15 at 10 11 50 AM

wwsean08 avatar Sep 15 '22 17:09 wwsean08