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
9 changes: 9 additions & 0 deletions eng/common/scripts/Verify-Links.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ foreach ($url in $urls) {

LogGroupStart "Link checking details"

$originalcheckLinkGuidance = $checkLinkGuidance

while ($pageUrisToCheck.Count -ne 0)
{
$pageUri = $pageUrisToCheck.Dequeue();
Expand All @@ -538,6 +540,11 @@ while ($pageUrisToCheck.Count -ne 0)
if ($checkedPages.ContainsKey($pageUri)) { continue }
$checkedPages[$pageUri] = $true;

# copilot instructions require the use of relative links which is against our general guidance
# but we mainly care about those guidelines for docs publishing and not copilot instructions
# so we can disable the guidelines while validating copilot instruction files.
if ($pageUri -match "instructions.md$") { $checkLinkGuidance = $false }

[string[]] $linkUris = GetLinks $pageUri
Write-Host "Checking $($linkUris.Count) links found on page $pageUri";
$badLinksPerPage = @();
Expand All @@ -561,6 +568,8 @@ while ($pageUrisToCheck.Count -ne 0)
} catch {
Write-Host "Exception encountered while processing pageUri $pageUri : $($_.Exception)"
throw
} finally {
$checkLinkGuidance = $originalcheckLinkGuidance
}
}

Expand Down