ci: Simplify getting branch HEAD commit hash

This is simpler and more reliable/predictable:

"git ls-remote 'heads/'" doesn't return anything, while "grep 'heads/'"
returns all branches, so a taskwarrior push causes most docker images
(those that don't have any TASK_VERSION and fallback to the Dockerfile
default) to be rebuilt, not just the one that needs to be.
This commit is contained in:
Tomas Janousek 2020-09-18 09:23:41 +02:00 committed by Tomas Babej
parent 36652d1f9b
commit 3498c51a46

View file

@ -26,11 +26,7 @@ jobs:
run: |
set -ex -o pipefail
shopt -s lastpipe
(
echo -n sha:
git ls-remote https://github.com/GothenburgBitFactory/taskwarrior.git | \
( grep heads/$TASK_VERSION || : ) | awk '{print $1}'
) | read -r TASK_DEVEL_SHA _ || :
git ls-remote https://github.com/GothenburgBitFactory/taskwarrior.git heads/"$TASK_VERSION" | read -r TASK_DEVEL_SHA _ || :
(
echo ALPINE_VERSION="$ALPINE_VERSION"
echo PYTHON_VERSION="$PYTHON_VERSION"