generated from osc/skins-template
Update .gitea/workflows/test-skins.yml
This commit is contained in:
@@ -16,25 +16,21 @@ jobs:
|
||||
#!/bin/bash
|
||||
set -o pipefail
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "🔍 Checking ALL Links in All Markdown Files"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "[Link Checker Job Started]"
|
||||
echo ""
|
||||
|
||||
# Find all markdown files
|
||||
find . -name "*.md" -type f | sort > all_markdown_files.txt
|
||||
total_files=$(wc -l < all_markdown_files.txt)
|
||||
echo "📊 Found $total_files markdown files to check"
|
||||
echo "Found $total_files markdown files to check"
|
||||
echo ""
|
||||
|
||||
has_errors=0
|
||||
file_index=1
|
||||
|
||||
# Process each markdown file
|
||||
while IFS= read -r md_file; do
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "📄 Checking: $md_file"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "[$file_index/$total_files] Checking: $md_file"
|
||||
|
||||
file_has_errors=0
|
||||
|
||||
@@ -51,13 +47,13 @@ jobs:
|
||||
link_count=$(wc -l < /tmp/links_$$.txt 2>/dev/null || echo "0")
|
||||
|
||||
if [ $link_count -eq 0 ]; then
|
||||
echo " ℹ️ No links found in this file"
|
||||
echo " → No links found"
|
||||
echo ""
|
||||
file_index=$((file_index + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
echo " 📊 Found $link_count links to check"
|
||||
echo ""
|
||||
echo " → Checking $link_count links..."
|
||||
|
||||
# Categorize and check links
|
||||
> /tmp/download_$$.txt
|
||||
@@ -91,7 +87,7 @@ jobs:
|
||||
|
||||
# Accept 2xx and 3xx status codes as valid
|
||||
if ! [[ "$http_code" =~ ^[23][0-9][0-9]$ ]]; then
|
||||
status="❌ (HTTP $http_code)"
|
||||
status="✖ (HTTP $http_code)"
|
||||
file_has_errors=1
|
||||
has_errors=1
|
||||
fi
|
||||
@@ -119,7 +115,7 @@ jobs:
|
||||
|
||||
# Check if file exists
|
||||
if ! [ -f "$file_path" ]; then
|
||||
status="❌ (not found)"
|
||||
status="✖ (not found)"
|
||||
file_has_errors=1
|
||||
has_errors=1
|
||||
fi
|
||||
@@ -216,24 +212,21 @@ jobs:
|
||||
rm -f /tmp/links_$$.txt
|
||||
|
||||
if [ $file_has_errors -eq 0 ]; then
|
||||
echo ""
|
||||
echo " ✅ All links valid in this file"
|
||||
echo " ✓ All links valid"
|
||||
else
|
||||
echo ""
|
||||
echo " ❌ Some links are broken in this file"
|
||||
echo " ✖ Some links broken"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
file_index=$((file_index + 1))
|
||||
done < all_markdown_files.txt
|
||||
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
|
||||
if [ $has_errors -eq 0 ]; then
|
||||
echo "✅ FINAL RESULT: All links are valid across all markdown files!"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "[Link Checker Complete — all links valid in $total_files files]"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ FINAL RESULT: Some links are broken. Please review the output above."
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "[Link Checker Complete — found broken links in $total_files files]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user