Update .gitea/workflows/test-skins.yml
All checks were successful
Test Skins / link-check (push) Successful in 20s
Generate Skin previews, OSK files and per skin documentation / Full CI/CD Pipeline (push) Successful in 28s

This commit is contained in:
2025-11-23 13:09:47 +01:00
parent 488bf1c010
commit 431c8436ce

View File

@@ -30,13 +30,11 @@ jobs:
local url="$1"
echo " → Checking external: $url"
# HEAD first
if curl -Is --max-time 10 "$url" | head -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
if curl -Is --max-time 10 "$url" | head -n1 | grep -qE "HTTP/.* (200|30[0-9])"; then
return 0
fi
# GET fallback
if curl -Is --max-time 10 -X GET "$url" | head -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
if curl -Is --max-time 10 -X GET "$url" | head -n1 | grep -qE "HTTP/.* (200|30[0-9])"; then
return 0
fi
@@ -45,7 +43,7 @@ jobs:
check_local() {
local path="$1"
path="${path#/}" # strip leading slash
path="${path#/}"
local decoded
decoded=$(urldecode "$path")
@@ -60,22 +58,17 @@ jobs:
extract_links() {
local file="$1"
# Markdown links
grep -oE '\[[^]]*\]\([^)]*\)' "$file" \
| sed -E 's/.*\((.*)\).*/\1/'
# Image markdown links
grep -oE '!\[[^]]*\]\([^)]*\)' "$file" \
| sed -E 's/.*\((.*)\).*/\1/'
# Raw URLs
grep -oE 'https?://[^ )"]+' "$file"
# <img src="">
grep -oE '<img[^>]*src="[^"]+"' "$file" \
| sed -E 's/.*src="([^"]*)".*/\1/'
# <video src="">
grep -oE '<video[^>]*src="[^"]+"' "$file" \
| sed -E 's/.*src="([^"]*)".*/\1/'
}
@@ -90,6 +83,17 @@ jobs:
[[ -z "$url" ]] && continue
[[ "$url" == mailto:* ]] && continue
###
# 🚫 Skip tag-version links inside /docs/*
###
if [[ "$mdfile" == ./docs/* ]] && [[ "$url" == *"/src/tag/"* ]]; then
echo " → Skipping tag link (allowed in docs): $url"
continue
fi
###
# Normal link checking
###
if [[ "$url" == http* ]]; then
if ! check_http "$url"; then
ERRORS+=("❌ Broken external link: $url (in $mdfile)")