Skip to content

Commit

Permalink
feat: closes #862 by adding a state attribute for the state of the in…
Browse files Browse the repository at this point in the history
…vite
  • Loading branch information
wwsean08 committed Oct 17, 2022
1 parent 05a8875 commit c9ecc70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions github/data_source_github_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func dataSourceGithubMembership() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"state": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -55,5 +59,6 @@ func dataSourceGithubMembershipRead(d *schema.ResourceData, meta interface{}) er
d.Set("username", membership.GetUser().GetLogin())
d.Set("role", membership.GetRole())
d.Set("etag", resp.Header.Get("ETag"))
d.Set("state", membership.GetState())
return nil
}
1 change: 1 addition & 0 deletions github/data_source_github_membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestAccGithubMembershipDataSource(t *testing.T) {
resource.TestCheckResourceAttr("data.github_membership.test", "username", testOwner),
resource.TestCheckResourceAttrSet("data.github_membership.test", "role"),
resource.TestCheckResourceAttrSet("data.github_membership.test", "etag"),
resource.TestCheckResourceAttrSet("data.github_membership.test", "state"),
)

testCase := func(t *testing.T, mode string) {
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/membership.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ data "github_membership" "membership_for_some_user" {
* `username` - The username.
* `role` - `admin` or `member` -- the role the user has within the organization.
* `etag` - An etag representing the membership object.
* `state` - `active` or `pending` -- the state of membership within the organization. `active` if the member has accepted the invite, or `pending` if the invite is still pending.

0 comments on commit c9ecc70

Please sign in to comment.