Skip to content

Commit

Permalink
Document the link check command
Browse files Browse the repository at this point in the history
  • Loading branch information
jmintuitive committed Sep 12, 2024
1 parent 2d42d58 commit ffab083
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
- name: Run Lychee Link Checker
uses: lycheeverse/lychee-action@v1
with:
# These args ensure that all relevant links are checked, without flaky failures.
#
# 1. The --remap helps resolve links which don't list their file extension since all relevant files are .mdx.
# It also accounts for headings in relative links. Ex. [abc](./file#header) -> .../file.mdx#header
# 2. TODO: When the /zh/ sections are all translated, please remove "--exclude '.*/zh/.*".
# This is a temporary measure since not all pages have been translated yet, but the links are still there.
# 3. --exclude '^(file:|[./]).*\.html$' - This section of exclusions avoids file paths for resources which are
# not actually relative links. They work at runtime by accessing the 'public' folder.
# 4. Other exclusions avoid flaky failures (from slow sites) or acceptable failures (from fake urls).
# 5. --accept '403,401,429' - These errors generally mean the link works, but our tool can't access them.
# 6. --retry-wait-time - The time in seconds to wait before trying again if we get a 429 error.
# 7. --max-retries - How many times we're willing to try again before failing the link.
args: >
--remap '(^[^.#]+)(\.?)(#.*)?$ $1.mdx$3'
--exclude '.*/zh/.*'
Expand Down

0 comments on commit ffab083

Please sign in to comment.