From 4232a5b5845bd1500619173b28b38a41a7f45fae Mon Sep 17 00:00:00 2001 From: Kartik Shah Date: Tue, 9 Jan 2024 18:56:55 +0530 Subject: [PATCH] ci: stricter filename checking in diff generation (#3801) --- 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