Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions scripts/hooks/values-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ set -e

echo "🔍 Validating values.yaml files..."

# Get changed values.yaml files
changed_values=$(git diff --cached --name-only | grep "values\.yaml$")
# pre-commit passes the matched files as arguments; fall back to staged
# values.yaml when invoked directly (e.g. as a manual git hook with no args).
# The `|| true` keeps `set -e` from aborting when grep finds no match.
if [ "$#" -gt 0 ]; then
changed_values=$(printf '%s\n' "$@" | grep "values\.yaml$" || true)
else
changed_values=$(git diff --cached --name-only | grep "values\.yaml$" || true)
fi

if [ -z "$changed_values" ]; then
echo "✅ No values.yaml changes detected"
Expand Down
Loading