From 2c90201f1df5a8a2962703b2df157b75d1db353b Mon Sep 17 00:00:00 2001 From: Predrag Ilkic Date: Mon, 24 Feb 2025 15:15:18 +0100 Subject: [PATCH] fix script for calculating docker tag Filter out `.txt` files in `env/` which are not tracked by git. Otherwise, the script generates wrong hashes in repos which are not completely clean. --- .github/get-docker-tag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/get-docker-tag.sh b/.github/get-docker-tag.sh index 11199fca6..b92525091 100755 --- a/.github/get-docker-tag.sh +++ b/.github/get-docker-tag.sh @@ -12,8 +12,8 @@ else MLIR_DOCKER_TAG="default-tag" fi -# The hash is based on the environment files -ENV_HASH=$(find env -type f -name "*.txt" | sort | xargs cat | sha256sum | cut -d ' ' -f 1) +# The hash is based on the environment files (filter out files that are not tracked in git). +ENV_HASH=$(find env -type f -name "*.txt" | sort | sed 's|^\./||' | grep -Fxf <(git ls-files env/) | xargs cat | sha256sum | cut -d ' ' -f 1) # The hash is based on the Dockerfile(s) DOCKERFILE_HASH=$(find .github -type f -name "Dockerfile.*" | sort | xargs cat | sha256sum | cut -d ' ' -f 1)