Skip to content

Commit 344ef64

Browse files
Sync eng/common directory with azure-sdk-tools for PR 12863 (#3338)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12863 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
1 parent f5755a7 commit 344ef64

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

eng/common/scripts/Verify-Links.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ foreach ($url in $urls) {
530530

531531
LogGroupStart "Link checking details"
532532

533+
$originalcheckLinkGuidance = $checkLinkGuidance
534+
533535
while ($pageUrisToCheck.Count -ne 0)
534536
{
535537
$pageUri = $pageUrisToCheck.Dequeue();
@@ -538,6 +540,11 @@ while ($pageUrisToCheck.Count -ne 0)
538540
if ($checkedPages.ContainsKey($pageUri)) { continue }
539541
$checkedPages[$pageUri] = $true;
540542

543+
# copilot instructions require the use of relative links which is against our general guidance
544+
# but we mainly care about those guidelines for docs publishing and not copilot instructions
545+
# so we can disable the guidelines while validating copilot instruction files.
546+
if ($pageUri -match "instructions.md$") { $checkLinkGuidance = $false }
547+
541548
[string[]] $linkUris = GetLinks $pageUri
542549
Write-Host "Checking $($linkUris.Count) links found on page $pageUri";
543550
$badLinksPerPage = @();
@@ -561,6 +568,8 @@ while ($pageUrisToCheck.Count -ne 0)
561568
} catch {
562569
Write-Host "Exception encountered while processing pageUri $pageUri : $($_.Exception)"
563570
throw
571+
} finally {
572+
$checkLinkGuidance = $originalcheckLinkGuidance
564573
}
565574
}
566575

0 commit comments

Comments
 (0)