Skip to content

Commit

Permalink
#2115: CI: fix check_containers script
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs authored and PhilMiller committed Mar 29, 2023
1 parent f08a785 commit 53ee3e5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/check_containers.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 53ee3e5

Please sign in to comment.