Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
12c913e
Add markdown link verification action and scripts
TravisEz13 Oct 15, 2025
7b2970c
Add Parse-MarkdownLink script and update references in Verify-Markdow…
TravisEz13 Oct 16, 2025
edd4536
Refactor HTTP link verification to use Invoke-WebRequest for improved…
TravisEz13 Oct 16, 2025
8354d9b
Enhance markdown link verification to support changed files detection…
TravisEz13 Oct 16, 2025
d74688d
Update workflow to verify all markdown files by default instead of CH…
TravisEz13 Oct 16, 2025
60ec84e
Break a link
TravisEz13 Oct 16, 2025
6845458
Enhance link verification to ignore specific HTTP status codes (401, …
TravisEz13 Oct 16, 2025
5ddda49
Enhance local link verification by stripping query parameters and anc…
TravisEz13 Oct 16, 2025
a75e158
Enhance HTTP link verification by adding a HEAD request method and re…
TravisEz13 Oct 16, 2025
d35c595
Revert "Break a link"
TravisEz13 Oct 16, 2025
a4343ae
Merge branch 'master' into markdownlinkcheck
TravisEz13 Oct 16, 2025
5b5f887
Enhance GitHub Actions summary reporting for markdown link verificati…
TravisEz13 Oct 16, 2025
e129033
Merge branch 'markdownlinkcheck' of https://github.com/powershell/pow…
TravisEz13 Oct 16, 2025
d74d574
Remove PR comment step for failed markdown link verification
TravisEz13 Oct 16, 2025
22ff4e7
Remove exclude patterns and fail-on-error parameters from action inputs
TravisEz13 Oct 16, 2025
836034d
Add PowerShell parameter naming conventions documentation
TravisEz13 Oct 16, 2025
02e0302
Refactor parameter names for consistency in markdown link verificatio…
TravisEz13 Oct 16, 2025
c8219a8
Remove unused 'path' input from markdown link verification action and…
TravisEz13 Oct 16, 2025
d52afcc
Update README.md to add workflow testing instructions and broken link…
TravisEz13 Oct 16, 2025
3eb6e96
Update .github/actions/infrastructure/markdownlinks/Verify-MarkdownLi…
TravisEz13 Oct 17, 2025
d2ca554
Fix indentation and improve code readability
TravisEz13 Oct 17, 2025
fe9f61e
Update .github/actions/infrastructure/markdownlinks/Verify-MarkdownLi…
TravisEz13 Oct 21, 2025
a2b600c
Merge branch 'master' into markdownlinkcheck
TravisEz13 Oct 21, 2025
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
Prev Previous commit
Next Next commit
Enhance link verification to ignore specific HTTP status codes (401, …
…403, 429) and improve error reporting for failed links
  • Loading branch information
TravisEz13 committed Oct 16, 2025
commit 684545819ea561a6b367f3ebfa572d834854db2d
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,48 @@ foreach ($linkGroup in $uniqueLinks) {
else {
$verifyResult.Error
}
Write-Host "✗ FAILED: $url - $errorMsg" -ForegroundColor Red
foreach ($occurrence in $occurrences) {
Write-Host " Found in: $($occurrence.Path):$($occurrence.Line):$($occurrence.Column)" -ForegroundColor DarkGray

# Determine if this status code should be ignored or treated as failure
# Ignore: 401 (Unauthorized), 403 (Forbidden), 429 (Too Many Requests - already retried)
# Fail: 404 (Not Found), 410 (Gone), 406 (Not Acceptable) - these indicate broken links
$shouldIgnore = $false
$ignoreReason = ""

switch ($verifyResult.StatusCode) {
401 {
$shouldIgnore = $true
$ignoreReason = "authentication required"
}
403 {
$shouldIgnore = $true
$ignoreReason = "access forbidden"
}
429 {
$shouldIgnore = $true
$ignoreReason = "rate limited (already retried)"
}
}

if ($shouldIgnore) {
Write-Host "⊘ IGNORED: $url - $errorMsg ($ignoreReason)" -ForegroundColor Yellow
Write-Verbose "Ignored error details for $url - Status: $($verifyResult.StatusCode) - $ignoreReason"
foreach ($occurrence in $occurrences) {
Write-Verbose " Found in: $($occurrence.Path):$($occurrence.Line):$($occurrence.Column)"
}
$results.Skipped++
}
else {
Write-Host "✗ FAILED: $url - $errorMsg" -ForegroundColor Red
foreach ($occurrence in $occurrences) {
Write-Host " Found in: $($occurrence.Path):$($occurrence.Line):$($occurrence.Column)" -ForegroundColor DarkGray
}
$results.Failed++
[void]$results.Errors.Add(@{
Url = $url
Error = $errorMsg
Occurrences = $occurrences
})
}
$results.Failed++
[void]$results.Errors.Add(@{
Url = $url
Error = $errorMsg
Occurrences = $occurrences
})
}
}

Expand Down
Loading