terraform-provider-github
terraform-provider-github copied to clipboard
feat: closes #862 by adding a state attribute for the state of org membership
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:
