diff --git a/backend/scripts/deploy.sh b/backend/scripts/deploy.sh index 2a8dbcc..419edbf 100755 --- a/backend/scripts/deploy.sh +++ b/backend/scripts/deploy.sh @@ -96,8 +96,13 @@ fi echo "Target: $TARGET_SHORT $(git log -1 --format='%s' "$TARGET_REF")" echo "" echo "Commits to apply:" -git log --oneline "$CURRENT_REV..$TARGET_REV" | head -20 -CHANGE_COUNT=$(git log --oneline "$CURRENT_REV..$TARGET_REV" | wc -l | tr -d ' ') +# Use git's own line limit (`-n 20`) rather than `| head -20`: piping to head +# closes the pipe after 20 lines and makes git log exit with SIGPIPE (141), +# which `set -o pipefail` propagates and `set -e` then uses to kill the +# script silently. Only bites when the deploy batch is >20 commits — i.e. +# real prod releases. First hit observed on the v1.3.0 prod deploy. +git log --oneline -n 20 "$CURRENT_REV..$TARGET_REV" +CHANGE_COUNT=$(git rev-list --count "$CURRENT_REV..$TARGET_REV") if [[ $CHANGE_COUNT -gt 20 ]]; then echo " ... and $((CHANGE_COUNT - 20)) more" fi