From 8925405788c77d1f4dd0e46ad65ec2ffe6b9e10c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 20 Sep 2023 23:42:34 +0200 Subject: [PATCH] Added `| head -1` to `git log` commands that fetch the current head. The reason is that `git log HEAD...HEAD~1` will return two or more commits if we're dealing with merge commits, so we must be explicit that we only need the latest one. --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3bb3f11393..09c938fffb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -128,7 +128,7 @@ steps: fi - | - if [ "$(git log --pretty=format:%s HEAD...HEAD~1)" == "[Automatic] Updated UI files" ]; then + if [ "$(git log --pretty=format:%s HEAD...HEAD~1 | head -1)" == "[Automatic] Updated UI files" ]; then echo "UI changes have already been committed, skipping build" exit 0 fi @@ -200,7 +200,7 @@ steps: - git config --global --add safe.directory $PWD - git pull --rebase origin master --tags - export VERSION=$(python setup.py --version) - - export HEAD=$(git log --pretty=format:%h HEAD...HEAD~1) + - export HEAD=$(git log --pretty=format:%h HEAD...HEAD~1 | head -1) - export GIT_VERSION="$VERSION.r$(git log --pretty=oneline HEAD...v$VERSION | wc -l).$HEAD" - export TAG_URL="https://git.platypush.tech/platypush/platypush/archive/v$VERSION.tar.gz"