Skip to content
23 changes: 23 additions & 0 deletions .github/workflows/check-external-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check External Links

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
external-links:
name: Check External URLs
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Check external links
uses: lycheeverse/lychee-action@v2
with:
args: --config lychee.toml '**/*.md' '**/*.mdx'
fail: true
43 changes: 23 additions & 20 deletions .github/workflows/mirror-pr-to-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,28 @@ jobs:
# Create new mirror PR
echo "Creating new mirror PR..."

# Create PR body content using printf to avoid shell parsing issues
printf '%s\n' \
"**🔗 Auto-generated mirror PR for Mintlify preview**" \
"" \
"**Original PR:** #${{ github.event.number }}" \
"**Author:** @${{ github.event.pull_request.user.login }}" \
"" \
"## Purpose" \
"This PR provides a Mintlify preview link for reviewing documentation changes." \
"" \
"## Preview Link" \
"The Mintlify preview will be available once this PR is processed." \
"" \
"## ⚠️ Important Notes" \
"- **Do not merge this PR directly**" \
"- This PR will be auto-merged when the original PR #${{ github.event.number }} is merged" \
"- Make all comments and reviews on the original PR #${{ github.event.number }}" \
"" \
"## Changes" \
"${{ github.event.pull_request.body }}" > pr_body.txt
# Write PR body to file via env var to safely handle special characters
# (backticks, $, quotes) without shell re-interpretation
cat > pr_body.txt << 'ENDBODY'
**🔗 Auto-generated mirror PR for Mintlify preview**

**Original PR:** #${{ github.event.number }}
**Author:** @${{ github.event.pull_request.user.login }}

## Purpose
This PR provides a Mintlify preview link for reviewing documentation changes.

## Preview Link
The Mintlify preview will be available once this PR is processed.

## ⚠️ Important Notes
- **Do not merge this PR directly**
- This PR will be auto-merged when the original PR #${{ github.event.number }} is merged
- Make all comments and reviews on the original PR #${{ github.event.number }}

## Changes
ENDBODY
printf '%s\n' "$PR_BODY" >> pr_body.txt

# Escape the title properly to handle special characters and spaces
ESCAPED_TITLE=$(printf '%s' "🔄 Preview: ${{ github.event.pull_request.title }}" | sed 's/"/\\"/g')
Expand All @@ -69,6 +71,7 @@ jobs:
fi
env:
GH_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}

cleanup-mirror-pr:
runs-on: ubuntu-latest
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ jobs:
run: |
echo "🔍 Running documentation validation..."
python scripts/validate_mintlify_docs.py . --validate-redirects --verbose


- name: Check anchor fragments
run: |
echo "⚓ Checking internal anchor fragments..."
python scripts/validate_mintlify_docs.py . --check-anchors --links-only

- name: Validation complete
if: success()
run: |
echo "✅ Documentation validation passed!"
echo "All links, images, navigation, and redirects are valid."
echo "All links, images, navigation, redirects, and anchors are valid."
42 changes: 42 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Lychee external link checker configuration
# Docs: https://lychee.cli.rs/usage/configuration/

# Only check http/https URLs — skips mailto:, file://, etc.
scheme = ["https", "http"]

# Resolve root-relative links (e.g. /img/..., /page/...) against the live docs
# base URL. Combined with the tyk.io exclude rule below, these get silently
# skipped rather than erroring as "cannot convert path to URI".
base_url = "https://tyk.io"

# Only check external URLs — internal links are validated by validate-docs.yml
exclude = [
# Tyk-owned domains (covers root-relative paths resolved via base above)
"https?://(.*\\.)?tyk\\.io",
"https?://(.*\\.)?tyktech\\.net",

# Localhost / private addresses
"https?://localhost",
"https?://127\\.0\\.0\\.1",

# Placeholder / example URLs
"https?://example\\.com",
"https?://your-",
"https?://<",

# Known to block bots / return false 403s
"https?://(www\\.)?linkedin\\.com",
"https?://(www\\.)?facebook\\.com",
]

# Treat these status codes as success (429 = rate-limited but link exists)
accept = [200, 201, 202, 203, 204, 206, 301, 302, 303, 307, 308, 429]

# Retry up to 3 times before marking a link as broken
max_retries = 3

# Timeout per request in seconds
timeout = 15

# Number of concurrent requests
max_concurrency = 8
Loading
Loading