-
Notifications
You must be signed in to change notification settings - Fork 24
Fix broken external links found with automated link checking #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
cf97781
Initial plan
Copilot 581abfe
Add check-links.yml workflow with all PR #424 feedback applied
Copilot d5168bd
Address all bart-vmware review feedback on check-links.yml and build-…
Copilot 68fb4ea
add link-checking of internal links of built site content
TimHess d1f19ab
process improvements, add local script for checking links from all do…
TimHess 5631660
focus on external link checking in static content
TimHess 6af1af4
drop branch filter from PR trigger
TimHess cc825fe
fix lychee install link
TimHess 82e6e9f
focus check-links job on external links, exclude vendored sources
TimHess ec140f6
add --root-dir to resolve root-relative image paths without error
TimHess 02374e2
Update .github/workflows/check-links.yml
TimHess 9016ef2
PR suggests and alphabetize lychee params
TimHess dd15c02
re-add root-dir, primarily for running in CI
TimHess ec3c124
re-add --verbose, local script enhancements
TimHess b0140cd
move settings to shared lychee.toml
TimHess b26c2cb
fix exclude_paths broken in move to lychee.toml
TimHess 83b2dab
isolate lychee caching to specific workstreams
TimHess e90bccc
Fix broken links
Copilot d7dab75
fix absolute .md links to relative paths
TimHess c6868d7
fix consul-register-example casing, fix broken eureka docs link
TimHess 3394f3e
fix anchors, reduce unnecessary redirects
TimHess b3cce71
use default verbosity, update cosmos connectionstring link
TimHess 96cfde0
drop training page
TimHess d3a6e97
Apply suggestions from code review
TimHess 7ab806f
address PR 424 review feedback
TimHess d373204
Update docs/docs/v2/connectors/cosmosdb.md
TimHess 0efa22b
Merge branch 'main' into copilot/scan-for-broken-links
TimHess a1a886e
More PR feedback
TimHess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Check external links | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
|
bart-vmware marked this conversation as resolved.
|
||
| - '**.md' | ||
| - 'docs/**' | ||
| - '.github/workflows/check-links.yml' | ||
| - 'lychee.toml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| check-links: | ||
| name: Check external links in documentation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Git checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| # To bust the lychee cache for a PR, replace `<pull-request-number>` with the PR number and run in pwsh: | ||
| # $ids = gh api repos/SteeltoeOSS/Documentation/actions/caches ` | ||
| # --paginate ` | ||
| # --jq '.actions_caches[] | ||
| # | select(.key | startswith("cache-lychee-<pull-request-number>-")) | ||
| # | .id' | ||
| # $ids | ForEach-Object { | ||
| # gh api -X DELETE "repos/SteeltoeOSS/Documentation/actions/caches/$_" | ||
| # Write-Host "Deleted cache $_" | ||
| # } | ||
| - name: Restore lychee cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .lycheecache | ||
| key: cache-lychee-${{ github.event.pull_request.number || 'manual' }}-${{ github.sha }} | ||
| restore-keys: cache-lychee-${{ github.event.pull_request.number || 'manual' }}- | ||
|
|
||
| - name: Check external links with lychee | ||
| uses: lycheeverse/lychee-action@v2 | ||
| with: | ||
| args: --no-progress '**/*.md' | ||
| fail: false | ||
| failIfEmpty: true | ||
| jobSummary: false | ||
|
|
||
| - name: Add link checking results to job summary | ||
| if: always() | ||
| run: | | ||
| if [ -f ./lychee/out.md ]; then | ||
| sed 's/^# Summary$/# External link checking results/' ./lychee/out.md | tee -a "$GITHUB_STEP_SUMMARY" > ./lychee/results.md | ||
| fi | ||
|
|
||
| - name: Comment on PR with link check results | ||
| if: always() && github.event_name == 'pull_request' | ||
|
bart-vmware marked this conversation as resolved.
Outdated
|
||
| uses: mshick/add-pr-comment@v2 | ||
| with: | ||
| message-id: external-links-check | ||
| message-path: ./lychee/results.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Check external links in markdown files, matching what the check-links CI job does. | ||
| # Run from anywhere in the repo. Requires lychee: https://lychee.cli.rs/guides/getting-started/ | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| if (-not (Get-Command lychee -ErrorAction SilentlyContinue)) { | ||
| throw 'lychee not found. Install: cargo install lychee, scoop install lychee, or winget install lycheeverse.lychee' | ||
| } | ||
|
|
||
| $baseDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $repoRoot = (Get-Item $baseDir).Parent.FullName | ||
| Push-Location $repoRoot | ||
|
|
||
| try { | ||
| $mdFiles = Get-ChildItem -Path . -Filter '*.md' -Recurse -File | ||
| if ($mdFiles.Count -eq 0) { | ||
| throw 'No .md files found in the repository.' | ||
| } | ||
|
|
||
| Write-Output "Checking external links in $($mdFiles.Count) markdown files ..." | ||
|
|
||
| & lychee '**/*.md' | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "lychee exited with code $LASTEXITCODE" | ||
| } | ||
| } | ||
| finally { | ||
| Pop-Location | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.