From 53ee3e58e674658f329e1d98b1c8e0c0824bafa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 28 Mar 2023 22:24:20 +0200 Subject: [PATCH] #2115: CI: fix `check_containers` script --- scripts/check_containers.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/check_containers.sh b/scripts/check_containers.sh index dd56b273f0..87e89121b6 100755 --- a/scripts/check_containers.sh +++ b/scripts/check_containers.sh @@ -1,11 +1,14 @@ #!/usr/bin/env bash -# Check if there were any dockerfiles modified in the latest pull request. -# Note: this is specific to the way Azure checks out git repo. +# Check if there were any dockerfiles modified in the PR. +# Note: this is specific to Azure - in the pipeline's local branch git history +# contains one merge commit for all of the changes in the PR. diff_latest() { - git diff --name-only "$(git log --skip=1 -1 --merges --pretty=format:%H)".. + printf "Files modified in the pull request:\n" >&2 + git diff --name-only HEAD^1 HEAD | tee >(cat >&2) } +# Decide which docker-compose command to use: if diff_latest | grep -i dockerfile > /dev/null then echo "build --pull"