From 86e660f70063eb389f45e4b0fa6a10e7e7abed63 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 08:51:43 -0700 Subject: [PATCH 1/6] basic link checker (no comment/pr/cron automation) --- .github/workflows/link-checker.yml | 24 +++++++++++ .lycheerc | 66 ++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/link-checker.yml create mode 100644 .lycheerc diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml new file mode 100644 index 00000000000..98f3426f1f9 --- /dev/null +++ b/.github/workflows/link-checker.yml @@ -0,0 +1,24 @@ +# .github/workflows/link-checker.yml + +name: "🔗 Broken Link Checker" + +on: + pull_request: + branches: [ main ] + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - name: "☁️ Checkout Repository" + uses: actions/checkout@v4 + + - name: "🔎 Run Link Checker" + uses: lycheeverse/lychee-action@v2 + with: + args: "--config ./lychee.toml ./src/content/**/*.md*" + # Do not show failed + fail: false + env: + # Required to check GitHub links without being rate-limited + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.lycheerc b/.lycheerc new file mode 100644 index 00000000000..a35ee951c05 --- /dev/null +++ b/.lycheerc @@ -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:", +] + From 432e3bc915fb2cfab912f2082e9ab4ad55fd0136 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 08:59:12 -0700 Subject: [PATCH 2/6] fix --- .github/workflows/link-checker.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 98f3426f1f9..d60ab196cb5 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -1,5 +1,3 @@ -# .github/workflows/link-checker.yml - name: "🔗 Broken Link Checker" on: @@ -11,13 +9,16 @@ jobs: runs-on: ubuntu-latest steps: - name: "☁️ Checkout Repository" - uses: actions/checkout@v4 + # Pinned to a full commit SHA to satisfy security best practices + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: "🔎 Run Link Checker" - uses: lycheeverse/lychee-action@v2 + # Pinned to a full commit SHA to satisfy the sha-ref validation error + uses: lycheeverse/lychee-action@2b591b68953f656281b36952a78484920668b598 # v2 with: - args: "--config ./lychee.toml ./src/content/**/*.md*" - # Do not show failed + # 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 From 69ac4a14bdc1d2e436d4923060b1722a63f9b3d3 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 09:06:12 -0700 Subject: [PATCH 3/6] fix --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index d60ab196cb5..b1eb4b129ff 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -14,7 +14,7 @@ jobs: - name: "🔎 Run Link Checker" # Pinned to a full commit SHA to satisfy the sha-ref validation error - uses: lycheeverse/lychee-action@2b591b68953f656281b36952a78484920668b598 # v2 + uses: lycheeverse/lychee-action@7da8ec1fc4e01b5a12062ac6c589c10a4ce70d67 # v2 with: # Points to your source files and uses your lycheerc config args: "--config ./lycheerc ./src/content/**/*.md*" From b784f9eb7826b21e1e24391988f03bcd70f94900 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 09:08:14 -0700 Subject: [PATCH 4/6] fix --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index b1eb4b129ff..96f515654df 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -17,7 +17,7 @@ jobs: uses: lycheeverse/lychee-action@7da8ec1fc4e01b5a12062ac6c589c10a4ce70d67 # v2 with: # Points to your source files and uses your lycheerc config - args: "--config ./lycheerc ./src/content/**/*.md*" + args: "--config ./.lycheerc ./src/content/**/*.md*" # Ensures the step passes so the check doesn't show as "failed" fail: false env: From b72a823793a8d04cb23774c6757840f18c796e2b Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 09:16:17 -0700 Subject: [PATCH 5/6] updated exclusions --- .lycheerc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.lycheerc b/.lycheerc index a35ee951c05..32a894e7018 100644 --- a/.lycheerc +++ b/.lycheerc @@ -9,7 +9,7 @@ verbose = "error" no_progress = false ############################# Runtime ############################# -# Temporarily accept 429 -- rate limiting by gnu.org is very aggressive!! +# Temporarily accept 429 to get a cleaner list. accept = '200, 202, 429' # Disable caching for clean test runs. @@ -29,6 +29,9 @@ timeout = 20 exclude_all_private = true exclude = [ + # Exclude all local file paths + "^file://", + # Blockchain Explorers (which cause 403 Forbidden errors) ".*scan\\.com", ".*scan\\.dev", @@ -39,6 +42,13 @@ exclude = [ "celoscan\\.io", "explorer\\.celo\\.org", "explorer\\.metis\\.io", + "explorer\\.arbitrum\\.io", + "sepolia-blockscout\\.scroll\\.io", + "lineascan\\.build", + "sonicscan\\.org", + "worldscan\\.org", + "abscan\\.org", + "bartio\\.beratrail\\.io", "docs\\.polygon\\.technology", # Other Services That Block Bots or Require Login @@ -53,6 +63,8 @@ exclude = [ "help\\.phantom\\.app", "app\\.roninchain\\.com", "www\\.tronlink\\.org", + "bridge\\.linea\\.build", + "www\\.reddit\\.com", # API endpoints that require authentication "api\\.dataengine\\.chain\\.link", @@ -62,5 +74,4 @@ exclude = [ # Common Local & Invalid Patterns "^http://(localhost|127\\.0\\.0\\.1)(:\\d+)?", "mailto:", -] - +] \ No newline at end of file From 1366e5cacf9894e7df2e987ba351b0a38a216992 Mon Sep 17 00:00:00 2001 From: Devin DiStefano Date: Wed, 2 Jul 2025 09:19:20 -0700 Subject: [PATCH 6/6] continue on error --- .github/workflows/link-checker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 96f515654df..b082e5b8994 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -15,6 +15,7 @@ jobs: - name: "🔎 Run Link Checker" # Pinned to a full commit SHA to satisfy the sha-ref validation error uses: lycheeverse/lychee-action@7da8ec1fc4e01b5a12062ac6c589c10a4ce70d67 # v2 + continue-on-error: true with: # Points to your source files and uses your lycheerc config args: "--config ./.lycheerc ./src/content/**/*.md*"