mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 03:13:23 +00:00
Update github API
This commit is contained in:
@@ -145,19 +145,17 @@ class GitHubApi
|
||||
|
||||
function Get-GitHubApi {
|
||||
param (
|
||||
[Parameter(ParameterSetName = 'RepositoryOwner')]
|
||||
[Parameter(ParameterSetName = 'RepositoryName')]
|
||||
[Parameter(ParameterSetName = 'RepositorySingle')]
|
||||
[string] $RepositoryFullName,
|
||||
[Parameter(ParameterSetName = 'RepositorySplitted')]
|
||||
[string] $RepositoryOwner,
|
||||
|
||||
[Parameter(ParameterSetName = 'RepositoryName')]
|
||||
[Parameter(ParameterSetName = 'RepositorySplitted')]
|
||||
[string] $RepositoryName,
|
||||
|
||||
[string] $AccessToken
|
||||
)
|
||||
|
||||
# Split repository name (like 'actions/versions-package-tools') in case when owner is not set
|
||||
if (-not $RepositoryOwner) {
|
||||
$RepositoryOwner = $RepositoryName.Split('/')[0]
|
||||
if ($PSCmdlet.ParameterSetName -eq "RepositorySingle") {
|
||||
$RepositoryOwner, $RepositoryName = $Repository.Split('/', 2)
|
||||
}
|
||||
|
||||
return [GitHubApi]::New($RepositoryOwner, $RepositoryName, $AccessToken)
|
||||
|
||||
Reference in New Issue
Block a user