From 6538fd11f073e4f32e9d276cb31f78feb91e38d0 Mon Sep 17 00:00:00 2001 From: Olufunke Moronfolu Date: Fri, 3 Jul 2026 14:42:45 +0200 Subject: [PATCH 1/5] Add Hugo build output guard to prevent silent deploy on failure --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e9b14eabd37..63e5a3ea517 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,10 @@ install: # Append output to hugo.log file to print at the end of the travis job # (see https://stackoverflow.com/questions/418896/how-to-redirect-output-to-a-file-and-stdout) - - travis_wait 15 bash -c './node_modules/.bin/hugo --environment $TRAVIS_BRANCH 2>&1 | tee -a $TRAVIS_BUILD_DIR/hugo.log' + # bash -o pipefail ensures Hugo's non-zero exit code is not masked by tee inside the subprocess + - travis_wait 15 bash -o pipefail -c './node_modules/.bin/hugo --environment $TRAVIS_BRANCH 2>&1 | tee -a $TRAVIS_BUILD_DIR/hugo.log' + # Hugo can exit 0 even on fatal errors — this check ensures the build produced pages before allowing a deploy + - test $(find public -name "*.html" | wc -l) -gt 100 || (echo "ERROR: Hugo produced no output — aborting" && exit 1) # normal htmltest takes too much memory - using a modified version which strips