-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd49a9f
commit ac30a81
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/GitHub/public/Repositories/Repositories/Get-GitHubRepositoryTags.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
filter Get-GitHubRepositoryTags { | ||
<# | ||
.SYNOPSIS | ||
List repository tags | ||
.DESCRIPTION | ||
List repository tags | ||
.EXAMPLE | ||
Get-GitHubRepositoryTags -Owner 'PSModule' -Repo 'GitHub' | ||
Gets all tags of the GitHub repository. | ||
.NOTES | ||
https://docs.github.com/rest/repos/repos#list-repository-tags | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
# The account owner of the repository. The name is not case sensitive. | ||
[Parameter()] | ||
[Alias('org')] | ||
[string] $Owner = (Get-GitHubConfig -Name Owner), | ||
|
||
# The name of the repository without the .git extension. The name is not case sensitive. | ||
[Parameter()] | ||
[string] $Repo = (Get-GitHubConfig -Name Repo), | ||
|
||
# The number of results per page (max 100). | ||
[Parameter()] | ||
[ValidateRange(1, 100)] | ||
[int] $PerPage = 30 | ||
) | ||
|
||
$body = $PSBoundParameters | ConvertFrom-HashTable | ConvertTo-HashTable -NameCasingStyle snake_case | ||
Remove-HashtableEntries -Hashtable $body -RemoveNames 'Owner', 'Repo' -RemoveTypes 'SwitchParameter' | ||
|
||
$inputObject = @{ | ||
APIEndpoint = "/repos/$Owner/$Repo/tags" | ||
Method = 'GET' | ||
Body = $body | ||
} | ||
|
||
Invoke-GitHubAPI @inputObject | ForEach-Object { | ||
Write-Output $_.Response | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters