Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions eng/common/scripts/Verify-Links.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ function ProcessLink([System.Uri]$linkUri) {
# See comment in function below for details.
return ProcessCratesIoLink $linkUri $matches['path']
}
elseif ($linkUri -match '^https?://(www\.)?npmjs\.com/package/.+') {
return ProcessNpmLink $linkUri
}
else {
return ProcessStandardLink $linkUri
}
Expand Down Expand Up @@ -157,6 +160,14 @@ function ProcessCratesIoLink([System.Uri]$linkUri, $path) {
return $true
}

function ProcessNpmLink([System.Uri]$linkUri) {
# npmjs.com started using Cloudflare which returns 403 and we need to instead check the registry api for existence checks
# https://github.com/orgs/community/discussions/174098#discussioncomment-14461226
$apiUrl = $linkUri.ToString() -replace '^https?://(?:www\.)?npmjs\.com/package/(.*)/v', 'https://registry.npmjs.org/$1'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you create a new PR that will update this replacement to support both version https://www.npmjs.com/package/@azure/ai-agents/v/1.1.0 and non-version npmjs urls https://www.npmjs.com/package/@azure/ai-agents?


return ProcessStandardLink ([System.Uri]$apiUrl)
}

function ProcessStandardLink([System.Uri]$linkUri) {
$headRequestSucceeded = $true
try {
Expand Down