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