From 28f6924ad201b11fec4b89e7069ad1a35c494a06 Mon Sep 17 00:00:00 2001 From: Kartik Shah Date: Tue, 9 Jan 2024 14:46:50 +0530 Subject: [PATCH] ci: stricter filename checking in diff generation --- ci/apps/tasks/open-charts-pr.sh | 2 +- ci/core/tasks/open-charts-pr.sh | 2 +- ci/tasks/open-charts-pr.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/apps/tasks/open-charts-pr.sh b/ci/apps/tasks/open-charts-pr.sh index 4ff9ba2246..b363693234 100755 --- a/ci/apps/tasks/open-charts-pr.sh +++ b/ci/apps/tasks/open-charts-pr.sh @@ -40,7 +40,7 @@ for commit in $(git log --format="%H" ${old_ref}..${ref}); do changed_files=$(git diff-tree --no-commit-id --name-only -r $commit) for file in ${changed_files[@]}; do - if [[ " ${app_src_files[*]} " == *"$file"* ]]; then + if printf '%s\n' "${app_src_files[@]}" | grep -Fxq "$file"; then relevant_commits+=($commit) break fi diff --git a/ci/core/tasks/open-charts-pr.sh b/ci/core/tasks/open-charts-pr.sh index 4ff9ba2246..b363693234 100755 --- a/ci/core/tasks/open-charts-pr.sh +++ b/ci/core/tasks/open-charts-pr.sh @@ -40,7 +40,7 @@ for commit in $(git log --format="%H" ${old_ref}..${ref}); do changed_files=$(git diff-tree --no-commit-id --name-only -r $commit) for file in ${changed_files[@]}; do - if [[ " ${app_src_files[*]} " == *"$file"* ]]; then + if printf '%s\n' "${app_src_files[@]}" | grep -Fxq "$file"; then relevant_commits+=($commit) break fi diff --git a/ci/tasks/open-charts-pr.sh b/ci/tasks/open-charts-pr.sh index 90fda5dfe1..0dcbf47031 100755 --- a/ci/tasks/open-charts-pr.sh +++ b/ci/tasks/open-charts-pr.sh @@ -41,7 +41,7 @@ for commit in $(git log --format="%H" ${old_ref}..${ref}); do changed_files=$(git diff-tree --no-commit-id --name-only -r $commit) for file in ${changed_files[@]}; do - if [[ " ${app_src_files[*]} " == *"$file"* ]]; then + if printf '%s\n' "${app_src_files[@]}" | grep -Fxq "$file"; then relevant_commits+=($commit) break fi