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.
This commit is contained in:
Fabio Manganiello 2023-09-20 23:42:34 +02:00
parent 4fa3d7b311
commit 8925405788
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -128,7 +128,7 @@ steps:
fi 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" echo "UI changes have already been committed, skipping build"
exit 0 exit 0
fi fi
@ -200,7 +200,7 @@ steps:
- git config --global --add safe.directory $PWD - git config --global --add safe.directory $PWD
- git pull --rebase origin master --tags - git pull --rebase origin master --tags
- export VERSION=$(python setup.py --version) - 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 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" - export TAG_URL="https://git.platypush.tech/platypush/platypush/archive/v$VERSION.tar.gz"