Skip to content

Commit

Permalink
Send authenticated request to query release tags (#16968)
Browse files Browse the repository at this point in the history
Co-authored-by: Praveen Kuttappan <[email protected]>
  • Loading branch information
azure-sdk and praveenkuttappan committed Feb 4, 2022
1 parent e07f181 commit cd620d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eng/common/scripts/artifact-metadata-parsing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 $_
Expand Down

0 comments on commit cd620d5

Please sign in to comment.