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" local url="$1"
echo " → Checking external: $url" echo " → Checking external: $url"
# HEAD first if curl -Is --max-time 10 "$url" | head -n1 | grep -qE "HTTP/.* (200|30[0-9])"; then
if curl -Is --max-time 10 "$url" | head -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
return 0 return 0
fi fi
# GET fallback if curl -Is --max-time 10 -X GET "$url" | head -n1 | grep -qE "HTTP/.* (200|30[0-9])"; then
if curl -Is --max-time 10 -X GET "$url" | head -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
return 0 return 0
fi fi
@@ -45,7 +43,7 @@ jobs:
check_local() { check_local() {
local path="$1" local path="$1"
path="${path#/}" # strip leading slash path="${path#/}"
local decoded local decoded
decoded=$(urldecode "$path") decoded=$(urldecode "$path")
@@ -60,22 +58,17 @@ jobs:
extract_links() { extract_links() {
local file="$1" local file="$1"
# Markdown links
grep -oE '\[[^]]*\]\([^)]*\)' "$file" \ grep -oE '\[[^]]*\]\([^)]*\)' "$file" \
| sed -E 's/.*\((.*)\).*/\1/' | sed -E 's/.*\((.*)\).*/\1/'
# Image markdown links
grep -oE '!\[[^]]*\]\([^)]*\)' "$file" \ grep -oE '!\[[^]]*\]\([^)]*\)' "$file" \
| sed -E 's/.*\((.*)\).*/\1/' | sed -E 's/.*\((.*)\).*/\1/'
# Raw URLs
grep -oE 'https?://[^ )"]+' "$file" grep -oE 'https?://[^ )"]+' "$file"
# <img src="">
grep -oE '<img[^>]*src="[^"]+"' "$file" \ grep -oE '<img[^>]*src="[^"]+"' "$file" \
| sed -E 's/.*src="([^"]*)".*/\1/' | sed -E 's/.*src="([^"]*)".*/\1/'
# <video src="">
grep -oE '<video[^>]*src="[^"]+"' "$file" \ grep -oE '<video[^>]*src="[^"]+"' "$file" \
| sed -E 's/.*src="([^"]*)".*/\1/' | sed -E 's/.*src="([^"]*)".*/\1/'
} }
@@ -90,6 +83,17 @@ jobs:
[[ -z "$url" ]] && continue [[ -z "$url" ]] && continue
[[ "$url" == mailto:* ]] && 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 [[ "$url" == http* ]]; then
if ! check_http "$url"; then if ! check_http "$url"; then
ERRORS+=("❌ Broken external link: $url (in $mdfile)") ERRORS+=("❌ Broken external link: $url (in $mdfile)")
@@ -112,7 +116,7 @@ jobs:
echo "$e" echo "$e"
done done
echo echo
echo -e "${RED}⚠️ Job will NOT fail (requested behavior).${RESET}" echo -e "${RED}⚠️ Job will NOT fail (requested behavior).${RESET}"
else else
echo -e "${GREEN}✔ All links OK!${RESET}" echo -e "${GREEN}✔ All links OK!${RESET}"
fi fi