Send authenticated request to query release tags (#3309)
Co-authored-by: Praveen Kuttappan <praveen.kuttappan@gmail.com>
This commit is contained in:
parent
9c79a0725d
commit
514080fa0c
@ -46,7 +46,10 @@ function CreateReleases($pkgList, $releaseApiUrl, $releaseSha) {
|
||||
# Retrieves the list of all tags that exist on the target repository
|
||||
function GetExistingTags($apiUrl) {
|
||||
try {
|
||||
return (Invoke-RestMethod -Method "GET" -Uri "$apiUrl/git/refs/tags" -MaximumRetryCount 3 -RetryIntervalSec 10) | % { $_.ref.Replace("refs/tags/", "") }
|
||||
$headers = @{
|
||||
"Authorization" = "token $($env:GH_TOKEN)"
|
||||
}
|
||||
return (Invoke-RestMethod -Method "GET" -Uri "$apiUrl/git/refs/tags" -Headers $headers -MaximumRetryCount 3 -RetryIntervalSec 10) | % { $_.ref.Replace("refs/tags/", "") }
|
||||
}
|
||||
catch {
|
||||
Write-Host $_
|
||||
|
||||
Loading…
Reference in New Issue
Block a user