From 0d4b7db2ad1210cb53eea0a9880d0e211a989479 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:17:03 -0800 Subject: [PATCH] Adjust link checking for copilot instructions (#6824) Disable link checking guidelines for copilot instruction files. Co-authored-by: Wes Haggard --- eng/common/scripts/Verify-Links.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eng/common/scripts/Verify-Links.ps1 b/eng/common/scripts/Verify-Links.ps1 index d4406c609..fe04a9b1d 100644 --- a/eng/common/scripts/Verify-Links.ps1 +++ b/eng/common/scripts/Verify-Links.ps1 @@ -530,6 +530,8 @@ foreach ($url in $urls) { LogGroupStart "Link checking details" +$originalcheckLinkGuidance = $checkLinkGuidance + while ($pageUrisToCheck.Count -ne 0) { $pageUri = $pageUrisToCheck.Dequeue(); @@ -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 = @(); @@ -561,6 +568,8 @@ while ($pageUrisToCheck.Count -ne 0) } catch { Write-Host "Exception encountered while processing pageUri $pageUri : $($_.Exception)" throw + } finally { + $checkLinkGuidance = $originalcheckLinkGuidance } }