generated from osc/skins-template
Update .gitea/workflows/test-skins.yml
This commit is contained in:
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user