Skip to content

Missing Org Role information from Get-GitHubOrganizationMember #398

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

Closed
montereyharris opened this issue Feb 15, 2023 · 1 comment
Closed
Labels
api completeness This is basic API functionality that hasn't been implemented yet. api-organizations duplicate This issue has already been seen before. See a comment for a reference to the previous issue.

Comments

@montereyharris
Copy link

Issue Details

When you run Get-GitHubOrganizationMember it only returns user information on the members and not the role with in the organization

Response in Github Documents
[
{
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
]

Steps to reproduce the issue

Get-GitHubOrganizationMember -OrganizationName chwinery
   # Include your repro steps here

Solution

Add the ability to get roles by adding -username parameter

Operating System

OsName : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}

PowerShell Version

Name Value


PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Module Version

Running: 0.16.1
Installed: 0.16.1

@montereyharris montereyharris added bug This relates to a bug in the existing module. triage needed An issue that needs to be reviewed by a member of the team. labels Feb 15, 2023
@HowardWolosky HowardWolosky added api completeness This is basic API functionality that hasn't been implemented yet. api-organizations duplicate This issue has already been seen before. See a comment for a reference to the previous issue. and removed bug This relates to a bug in the existing module. triage needed An issue that needs to be reviewed by a member of the team. labels Feb 15, 2023
@HowardWolosky
Copy link
Member

There's no bug here. Get-GitHubOrganizationMember currently maps to the functionality exposed by the API to list the members of an organization which also does not return role information.

What you're looking for is getting the organization memberships for a user which does return the role information. That API has simply not been implemented yet. @tigerfansga had previously indicated that they were planning to implement that as part of #351, but I haven't heard any updates on that yet (although I think their work on migrating all of the tests to Pester 5 (#194) probably took up more time than originally anticipated).

Closing this off as a dupe since we're already tracking API completeness for Organizations with #351.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api completeness This is basic API functionality that hasn't been implemented yet. api-organizations duplicate This issue has already been seen before. See a comment for a reference to the previous issue.
Projects
None yet
Development

No branches or pull requests

2 participants