-
Notifications
You must be signed in to change notification settings - Fork 447
(experimental) broken link checker (lychee) #2792
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
Draft
dev-dist
wants to merge
6
commits into
main
Choose a base branch
from
experimental/broken-link-checker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "🔗 Broken Link Checker" | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "☁️ Checkout Repository" | ||
# Pinned to a full commit SHA to satisfy security best practices | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: "🔎 Run Link Checker" | ||
# Pinned to a full commit SHA to satisfy the sha-ref validation error | ||
uses: lycheeverse/lychee-action@2b591b68953f656281b36952a78484920668b598 # v2 | ||
with: | ||
# Points to your source files and uses your lycheerc config | ||
args: "--config ./lycheerc ./src/content/**/*.md*" | ||
# Ensures the step passes so the check doesn't show as "failed" | ||
fail: false | ||
env: | ||
# Required to check GitHub links without being rate-limited | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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,66 @@ | ||
# This file is used by the Lychee link checker to validate links in the documentation. | ||
# The GH action is configured to check documentation source files (./src/content/**/*.md*) | ||
# The exclude section below contains patterns to ignore certain links that are known to be problematic/not relevant | ||
# Most notably, blockchain explorers, API endpoints that require authentication, and other support services that block bots or require login | ||
|
||
############################# Display ############################# | ||
# Show informational output during the run | ||
verbose = "error" | ||
no_progress = false | ||
|
||
############################# Runtime ############################# | ||
# Temporarily accept 429 -- rate limiting by gnu.org is very aggressive!! | ||
accept = '200, 202, 429' | ||
|
||
# Disable caching for clean test runs. | ||
cache = false | ||
|
||
max_concurrency = 10 | ||
max_retries = 3 | ||
retry_wait_time = 5 | ||
|
||
############################# Requests ############################ | ||
base_url = "https://docs.chain.link/" | ||
timeout = 20 | ||
|
||
############################# Exclusions ########################## | ||
|
||
# Exclude private, local, and loopback | ||
exclude_all_private = true | ||
|
||
exclude = [ | ||
# Blockchain Explorers (which cause 403 Forbidden errors) | ||
".*scan\\.com", | ||
".*scan\\.dev", | ||
".*scan\\.io", | ||
".*scan\\.xyz", | ||
"basescan\\.org", | ||
"snowtrace\\.io", | ||
"celoscan\\.io", | ||
"explorer\\.celo\\.org", | ||
"explorer\\.metis\\.io", | ||
"docs\\.polygon\\.technology", | ||
|
||
# Other Services That Block Bots or Require Login | ||
"infura\\.io", | ||
"stackoverflow\\.com", | ||
"ethereum\\.stackexchange\\.com", | ||
"support\\.metamask\\.io", | ||
"support\\.chainstack\\.com", | ||
"faucet\\.polygon\\.technology", | ||
"www\\.forex\\.com", | ||
"debridges\\.com", | ||
"help\\.phantom\\.app", | ||
"app\\.roninchain\\.com", | ||
"www\\.tronlink\\.org", | ||
|
||
# API endpoints that require authentication | ||
"api\\.dataengine\\.chain\\.link", | ||
"api\\.testnet-dataengine\\.chain\\.link", | ||
"app\\.dev3\\.sh", # Requires payment | ||
|
||
# Common Local & Invalid Patterns | ||
"^http://(localhost|127\\.0\\.0\\.1)(:\\d+)?", | ||
"mailto:", | ||
] | ||
|
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 1 month ago
To fix the issue, we will add a
permissions
block at the root of the workflow file. Since the workflow only needs to read repository contents and use theGITHUB_TOKEN
for checking links, we will setcontents: read
as the minimal required permission. This ensures the workflow adheres to the principle of least privilege.