generated from osc/skins-template
Update .gitea/workflows/test-skins.yml
This commit is contained in:
@@ -28,14 +28,18 @@ jobs:
|
|||||||
|
|
||||||
check_http() {
|
check_http() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
|
echo " → Checking external: $url"
|
||||||
|
|
||||||
# HEAD first
|
# 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 -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# GET fallback
|
# 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 -n 1 | grep -qE "HTTP/.* (200|30[0-9])"; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,6 +49,8 @@ jobs:
|
|||||||
local decoded
|
local decoded
|
||||||
decoded=$(urldecode "$path")
|
decoded=$(urldecode "$path")
|
||||||
|
|
||||||
|
echo " → Checking local: $decoded"
|
||||||
|
|
||||||
if [[ ! -e "$decoded" ]]; then
|
if [[ ! -e "$decoded" ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -99,12 +105,16 @@ jobs:
|
|||||||
echo
|
echo
|
||||||
done < <(find . -type f -name '*.md')
|
done < <(find . -type f -name '*.md')
|
||||||
|
|
||||||
|
echo
|
||||||
if (( ${#ERRORS[@]} > 0 )); then
|
if (( ${#ERRORS[@]} > 0 )); then
|
||||||
echo -e "${RED}✖ Errors found:${RESET}"
|
echo -e "${RED}✖ Broken Links & Missing Files Found:${RESET}"
|
||||||
for e in "${ERRORS[@]}"; do
|
for e in "${ERRORS[@]}"; do
|
||||||
echo "$e"
|
echo "$e"
|
||||||
done
|
done
|
||||||
exit 1
|
echo
|
||||||
|
echo -e "${RED}⚠️ Job will NOT fail (requested behavior).${RESET}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}✔ All links OK!${RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}✔ All links OK!${RESET}"
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user