Skip to content

Commit 17b23c3

Browse files
committed
Add check for warnings
1 parent 61960e6 commit 17b23c3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/jekyll-build-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
fetch-depth: 1
2020

2121
- name: Build with Jekyll
22+
id: jekyll-build
2223
uses: actions/jekyll-build-pages@v1
2324
with:
2425
source: .
@@ -28,6 +29,32 @@ jobs:
2829
verbose: true
2930
token: ${{ secrets.GITHUB_TOKEN }}
3031

32+
- name: Check for build warnings
33+
run: |
34+
echo "🔍 Checking for potential Jekyll warnings..."
35+
36+
# Check for YAML front matter issues in markdown files
37+
YAML_ERRORS=0
38+
find . -name "*.md" -not -path "./_site/*" -not -path "./vendor/*" -not -path "./docs/external/*" | while read file; do
39+
if head -20 "$file" | grep -q "^---$" && head -20 "$file" | tail -n +2 | grep -q "^---$"; then
40+
# File has front matter, check for common YAML issues
41+
FRONT_MATTER=$(awk '/^---$/{if(NF==1 && !f) f=NR; if(f && NR>f) exit} f && NR>f{print}' "$file")
42+
if echo "$FRONT_MATTER" | grep -E '^\s*[^:]+\s+[^:]+\s*$'; then
43+
echo "⚠️ Potential YAML syntax issue in $file"
44+
echo "$FRONT_MATTER" | grep -E '^\s*[^:]+\s+[^:]+\s*$' | head -3
45+
YAML_ERRORS=$((YAML_ERRORS + 1))
46+
fi
47+
fi
48+
done
49+
50+
51+
# Check for common Jekyll configuration issues
52+
if grep -q "baseurl.*github.io" _config.yml 2>/dev/null; then
53+
echo "⚠️ Warning: baseurl may contain github.io domain - this might cause issues with custom domains"
54+
fi
55+
56+
echo "✅ Warning check completed"
57+
3158
- name: Test build artifacts
3259
run: |
3360
if [ ! -d "_site" ]; then
@@ -46,3 +73,6 @@ jobs:
4673
echo " - HTML files: $(find _site -name "*.html" | wc -l)"
4774
echo " - CSS files: $(find _site -name "*.css" | wc -l)"
4875
echo " - JS files: $(find _site -name "*.js" | wc -l)"
76+
77+
echo ""
78+
echo "💡 Note: Check the 'Build with Jekyll' step above for any warnings in the build output"

0 commit comments

Comments
 (0)