-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f6f7c8
commit efc967e
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,18 @@ | ||
# Ignore certain URLs or patterns | ||
exclude = [ | ||
"localhost", # Ignore localhost links | ||
"example.com", # Ignore example domains | ||
"http://127.0.0.1" # Ignore local IP links | ||
] | ||
|
||
# Retry failed links before reporting | ||
retry = 3 | ||
|
||
# Timeout for links (in seconds) | ||
timeout = 10 | ||
|
||
# Acceptable status codes | ||
accept = [200, 403] | ||
|
||
# Maximum concurrency for checking links | ||
max_concurrency = 10 |
This file contains 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,36 @@ | ||
name: Check Broken Links | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "**/*.md" | ||
- "**/*.mdx" | ||
- "**/*.html" | ||
|
||
jobs: | ||
link-check: | ||
name: Validate Links | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Lychee | ||
run: | | ||
wget -q https://github.com/lycheeverse/lychee/releases/latest/download/lychee-linux-x86_64.tar.gz | ||
tar -xzf lychee-linux-x86_64.tar.gz | ||
sudo mv lychee /usr/local/bin/ | ||
- name: Run Link Checker | ||
run: | | ||
lychee \ | ||
--config .github/config/lychee.toml \ | ||
--accept=200,403 \ | ||
--no-progress \ | ||
'**/*.md' '**/*.mdx' '**/*.html' | ||
- name: Report Failure on Broken Links | ||
if: failure() | ||
run: | | ||
echo "::error:: Broken links detected. Please fix them before merging." |