diff --git a/eng/common/scripts/artifact-metadata-parsing.ps1 b/eng/common/scripts/artifact-metadata-parsing.ps1 index 96bf76254..1fc388d1d 100644 --- a/eng/common/scripts/artifact-metadata-parsing.ps1 +++ b/eng/common/scripts/artifact-metadata-parsing.ps1 @@ -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 $_