Open woter1832 opened 1 year ago
This feature was started with #305 but was never completed.
@HowardWolosky,
Thanks for the reference. There's quite a lot involved! Although it does appear the docs have been updated to state visibility
is for Enterprise organisations only:
I'll try and find time to run the organizations
endpoint against my Enterprise organisation to see what I get for plan.name
in the response.
Thanks.
That was easier than I thought:
PS C:\> $oReq = Invoke-GHRestMethod -UriFragment "orgs/{my-enterprise-org}/" -Method Get -Description "Get organisation"
PS C:\> $oReq.plan
name : enterprise
space : 976562499
private_repos : 999999
filled_seats : 2794
seats : 3000
Running the same thing against my own non-enterprise org:
PS C:\> $oReq = Invoke-GHRestMethod -UriFragment "orgs/{my-non-enterprise-org}/" -Method Get -Description "Get organisation"
PS C:\> $oReq.plan
name : free
space : 976562499
private_repos : 10000
filled_seats : 2
seats : 1
As plan.name
returns enterprise
and free
, perhaps we can use this to determine the type of organisation. I guess we'd need a new function Get-GitHubOrganization
too.
Thanks
Any plans to add this in?
Some organizations have Public repos disabled by default, so you could create repos as Private or Interal from the UI, but you can only do Private from the Github pwsh module.
It's then impossible to change the visibility of the repo through the Github module alone. Sure, you can go through the API directly, but it would have been a lot more helpful to have the Github module actually support this.
Feature Idea Summary
Support Visibility body parameter: https://docs.github.com/en/rest/repos/repos#create-an-organization-repository
Feature Idea Additional Details
Requested Assignment
However, I have tested the change for
New-GithubRepository
File: GitHubRepository.ps1.PARAMETER Internal
By default, this repository will be created Public. Specify this to create
an internal repository (GH Enterprise Cloud/Server 2.20+ only).
[switch] $Internal,
if ($PSBoundParameters.ContainsKey('Internal')) { $hashBody['visibility'] = "internal" }
It works, but I know the above would have to be added to many other functions. I also don't know enough about Pester to submit a PR.
Operating System
PowerShell Version
Module Version
Please note: I have bumped the version number in my testing.
Thanks.