ci: ensure microblog/ is not empty

This commit is contained in:
Ming Di Leom 2024-09-28 22:34:00 +00:00
parent 55ebe2520d
commit 8042d4195a
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ test:
- sh check-homepage.sh - sh check-homepage.sh
rules: rules:
- if: '$RENOVATE != "true" && $CI_COMMIT_REF_NAME == "master" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")' - if: '$RENOVATE != "true" && $CI_COMMIT_REF_NAME == "microblog" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
when: always when: always
artifacts: artifacts:

View File

@ -5,12 +5,12 @@
HOMEPAGE="public/microblog/index.html" HOMEPAGE="public/microblog/index.html"
if [ ! -f "$HOMEPAGE" ]; then if [ ! -f "$HOMEPAGE" ]; then
echo "Error: homepage doesn't exist" echo "Error: microblog doesn't exist"
exit 1 exit 1
else else
FILE_SIZE=$(ls -s "$HOMEPAGE" | cut -d" " -f1) FILE_SIZE=$(ls -s "$HOMEPAGE" | cut -d" " -f1)
if [ "$FILE_SIZE" = 0 ]; then if [ "$FILE_SIZE" = 0 ]; then
echo "Error: homepage is empty" echo "Error: microblog is empty"
exit 1 exit 1
fi fi
fi fi