Skip to content

Commit

Permalink
Avoid partial match
Browse files Browse the repository at this point in the history
Signed-off-by: Chenxiong Qi <[email protected]>
  • Loading branch information
tkdchen committed Jan 9, 2025
1 parent e029c3f commit 32172c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hack/validate-migration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down

0 comments on commit 32172c8

Please sign in to comment.