Skip to content

Commit 2a1f17f

Browse files
jaw-shclaude
andcommitted
ci: use warnings instead of failures for file size check
Change 14KB file size check from hard failure to warning annotations. Files exceeding the limit will show warnings in GitHub Actions UI but won't block deployment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2f229c8 commit 2a1f17f

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/github-pages.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ jobs:
5050
echo "Checking HTML files against 14KB TCP initial congestion window..."
5151
echo "(Exempting /legal/ directory)"
5252
MAX_SIZE=14000
53-
FAILED=0
53+
WARNED=0
5454
5555
# Check HTML files (excluding /legal/ directory)
5656
for file in $(find public -name "*.html" -type f | grep -v "public/legal/"); do
5757
size=$(stat -c%s "$file")
5858
if [ "$size" -gt "$MAX_SIZE" ]; then
59-
echo "FAIL: $file is ${size} bytes (limit: ${MAX_SIZE})"
60-
FAILED=1
59+
echo "::warning file=$file::File is ${size} bytes (exceeds ${MAX_SIZE} byte limit)"
60+
WARNED=1
6161
else
6262
echo "OK: $file is ${size} bytes"
6363
fi
@@ -69,16 +69,14 @@ jobs:
6969
echo "EXEMPT: $file is ${size} bytes (legal content)"
7070
done
7171
72-
if [ "$FAILED" -eq 1 ]; then
72+
if [ "$WARNED" -eq 1 ]; then
7373
echo ""
74-
echo "Some HTML files exceed the 14KB limit!"
75-
echo "See: https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/"
76-
exit 1
74+
echo "::notice::Some HTML files exceed 14KB. See: https://endtimes.dev/why-your-website-should-be-under-14kb-in-size/"
75+
else
76+
echo ""
77+
echo "All checked HTML files are within the 14KB limit."
7778
fi
7879
79-
echo ""
80-
echo "All checked HTML files are within the 14KB limit."
81-
8280
- name: 'deploy to github pages'
8381
uses: shalzz/zola-deploy-action@master
8482
env:

0 commit comments

Comments
 (0)