Skip to content

Commit cc2c5f9

Browse files
azure-sdkweshaggardCopilot
authored
Sync eng/common directory with azure-sdk-tools for PR 13281 (Azure#3414)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13281 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com> Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 95075b4 commit cc2c5f9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

eng/common/scripts/Verify-Links.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function ProcessLink([System.Uri]$linkUri) {
120120
# See comment in function below for details.
121121
return ProcessCratesIoLink $linkUri $matches['path']
122122
}
123+
elseif ($linkUri -match '^https?://(www\.)?npmjs\.com/package/.+') {
124+
return ProcessNpmLink $linkUri
125+
}
123126
else {
124127
return ProcessStandardLink $linkUri
125128
}
@@ -157,6 +160,14 @@ function ProcessCratesIoLink([System.Uri]$linkUri, $path) {
157160
return $true
158161
}
159162

163+
function ProcessNpmLink([System.Uri]$linkUri) {
164+
# npmjs.com started using Cloudflare which returns 403 and we need to instead check the registry api for existence checks
165+
# https://github.com/orgs/community/discussions/174098#discussioncomment-14461226
166+
$apiUrl = $linkUri.ToString() -replace '^https?://(?:www\.)?npmjs\.com/package/(.*)/v', 'https://registry.npmjs.org/$1'
167+
168+
return ProcessStandardLink ([System.Uri]$apiUrl)
169+
}
170+
160171
function ProcessStandardLink([System.Uri]$linkUri) {
161172
$headRequestSucceeded = $true
162173
try {

0 commit comments

Comments
 (0)