From 3498c51a46c5fcca1b78c17f380ef98c22a7377f Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Fri, 18 Sep 2020 09:23:41 +0200 Subject: [PATCH] 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. --- .github/workflows/tests.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7d0cf0a..0d453cc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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"