Files
klz-cables.com/scripts/check-links.sh
Marc Mintel 3de62dba04
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 28s
Build & Deploy / 🧪 QA (push) Successful in 3m53s
Build & Deploy / 🏗️ Build (push) Successful in 2m39s
Build & Deploy / 🚀 Deploy (push) Successful in 27s
Build & Deploy / 🧪 Smoke Test (push) Successful in 49s
Build & Deploy / ♿ WCAG (push) Successful in 2m3s
Build & Deploy / 🛡️ Quality Gates (push) Successful in 3m24s
Build & Deploy / ⚡ Lighthouse (push) Successful in 7m2s
Build & Deploy / 🔔 Notify (push) Successful in 8s
ci: fix lychee link checker binary on ARM and handle false positives
2026-02-22 17:34:54 +01:00

55 lines
1.5 KiB
Bash

#!/bin/bash
set -e
# Auto-provision Lychee Rust Binary if missing
if [ ! -f ./lychee ]; then
echo "📥 Downloading Lychee Link Checker (v0.15.1)..."
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
VERSION="lychee-v0.23.0"
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "amd64" ]; then
ARCH_MAPPED="x86_64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH_MAPPED="aarch64"
else
echo "❌ Unsupported architecture: $ARCH"
exit 1
fi
if [ "$OS" = "darwin" ]; then
TARGET="arm64-macos"
elif [ "$OS" = "linux" ]; then
TARGET="${ARCH_MAPPED}-unknown-linux-gnu"
else
echo "❌ Unsupported OS: $OS"
exit 1
fi
DOWNLOAD_URL="https://github.com/lycheeverse/lychee/releases/download/${VERSION}/lychee-${TARGET}.tar.gz"
echo "Downloading from $DOWNLOAD_URL"
curl -sSLo lychee.tar.gz "$DOWNLOAD_URL"
tar -xzf lychee.tar.gz lychee
rm lychee.tar.gz
chmod +x ./lychee
fi
echo "🚀 Starting Deep Link Assessment (Lychee)..."
# Exclude localhost, mintel.me (internal infrastructure), and common placeholder domains
# Scan markdown files and component files for hardcoded dead links
./lychee \
--exclude "localhost" \
--exclude "127.0.0.1" \
--exclude "mintel\.me" \
--exclude "example\.com" \
--exclude "linkedin\.com" \
--exclude "fonts\." \
--base-url "http://127.0.0.1" \
--accept 200,204,308,401,403,999 \
"./data/**/*.mdx" "./data/**/*.md" "./app/**/*.tsx" "./components/**/*.tsx"
echo "✅ All project source links are alive and healthy!"