diff --git a/hack/validate-migration.sh b/hack/validate-migration.sh index 889fc28089..ca03e9a872 100755 --- a/hack/validate-migration.sh +++ b/hack/validate-migration.sh @@ -259,11 +259,12 @@ list_migration_files() { case "$status" in A) # file is added task_dir_path=$(awk -F '/' '{ OFS = "/"; print $1, $2 }' <<<"$origin_path") - if grep -q "$task_dir_path" <<<"$seen"; then + if grep -q "^${task_dir_path}$" <<<"$seen"; then echo "error: There must be one migration file per task in a single pull request." >&2 return 1 else - seen="$seen $task_dir_path" + seen="$seen +$task_dir_path" echo "$origin_path" fi ;;