Skip to content

Commit 8fb240c

Browse files
Send authenticated request to query release tags (Azure#22900)
Co-authored-by: Praveen Kuttappan <praveen.kuttappan@gmail.com>
1 parent 52a74ed commit 8fb240c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

eng/common/scripts/artifact-metadata-parsing.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ function CreateReleases($pkgList, $releaseApiUrl, $releaseSha) {
4646
# Retrieves the list of all tags that exist on the target repository
4747
function GetExistingTags($apiUrl) {
4848
try {
49-
return (Invoke-RestMethod -Method "GET" -Uri "$apiUrl/git/refs/tags" -MaximumRetryCount 3 -RetryIntervalSec 10) | % { $_.ref.Replace("refs/tags/", "") }
49+
$headers = @{
50+
"Authorization" = "token $($env:GH_TOKEN)"
51+
}
52+
return (Invoke-RestMethod -Method "GET" -Uri "$apiUrl/git/refs/tags" -Headers $headers -MaximumRetryCount 3 -RetryIntervalSec 10) | % { $_.ref.Replace("refs/tags/", "") }
5053
}
5154
catch {
5255
Write-Host $_

0 commit comments

Comments
 (0)