microsoft / PowerShellForGitHub

Microsoft PowerShell wrapper for GitHub API
Other
588 stars 185 forks source link

Set-GitHubRepositoryTeamPermission Support Custom Repository Role Name #352

Open tbulding opened 2 years ago

tbulding commented 2 years ago

Feature Idea Summary

The GitHub API for Add or update team repository permissions Supports the use of Custom Repository Roles. It would be beneficial to extend that support to this function.

Feature Idea Additional Details

Per the GH API documentation:

permission The permission to grant the team on this repository. In addition to the enumerated values, you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's permission attribute will be used to determine what permission to grant the team on this repository.

Requested Assignment

I'm just suggesting this idea, but don't want to implement it.

Operating System

Name Value


OSVersion Unix 12.3.1 Is 64-bit True Current culture en-US Current UI culture en-US

PowerShell Version

Name Value


PSVersion 7.2.1 PSEdition Core GitCommitId 7.2.1 OS Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Platform Unix 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.0 Installed: 0.16.0

HowardWolosky commented 2 years ago

Thanks for bringing this up. From what I can tell, this is a GitHub Enterprise/GitHub Cloud-only feature. It doesn't appear to be possible to create custom Roles on the public GitHub.com site, so I'm unable to test out/validate the experience. If someone who does have access to GitHub Enterprise/Cloud is interested in working on this, please reach out and let me know.

If we were to move forward with this, we'd have to look at a slight change to the Set-GitHubRepositoryTeamPermission signature to allow for a custom role to be passed-in, and we'd have to reexamine the logic used in Add-GitHubRepositoryTeamPermissionAdditionalProperties which adds the custom permission property to the object.