Fix dockerfilegraph pre-commit hook (#17698)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-05-06 09:56:48 +01:00
committed by GitHub
parent 6eae34533a
commit 05e1f96419
3 changed files with 6 additions and 5 deletions

View File

@@ -4,8 +4,11 @@
set -euo pipefail
# Check if docker/Dockerfile is staged for commit
if git diff --cached --name-only | grep -q "^docker/Dockerfile$"; then
# Accept file paths as arguments
FILES=("$@")
# Check if docker/Dockerfile is among the provided files
if printf '%s\n' "${FILES[@]}" | grep -q "^docker/Dockerfile$"; then
echo "docker/Dockerfile has changed, attempting to update dependency graph..."
# Check if Docker is installed and running
@@ -75,4 +78,4 @@ if git diff --cached --name-only | grep -q "^docker/Dockerfile$"; then
fi
fi
exit 0
exit 0