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

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

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

wwsean08
Copy link
Contributor

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

Copy link
Contributor

@mdb mdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wwsean08 ! To me, this seems reasonable and helpful.

@wwsean08 wwsean08 force-pushed the issue/862 branch 4 times, most recently from 3bf6a78 to 4afb875 Compare September 24, 2022 03:18
@wwsean08 wwsean08 changed the title feat: closes #862 by adding a state attribute for the state of org membership feat: closes #862 by adding a state attribute for the state of org membership Oct 10, 2022
@wwsean08 wwsean08 force-pushed the issue/862 branch 4 times, most recently from 333b79b to c9ecc70 Compare October 17, 2022 15:48
@wwsean08
Copy link
Contributor Author

Just checking if there is anything that y'all want me to do in order to get this reviewed as I think I followed the contribution guidelines

@wwsean08 wwsean08 force-pushed the issue/862 branch 6 times, most recently from 5e8b935 to 5b3cefa Compare November 1, 2022 03:15
Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing, and apologies for the delay! I'll get this merged and released soon.

@kfcampbell kfcampbell merged commit bbc334c into integrations:main Nov 8, 2022
@wwsean08 wwsean08 deleted the issue/862 branch November 8, 2022 16:35
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
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

Successfully merging this pull request may close these issues.

Feature request: Provide membership status in the github_membership data source.
3 participants