From 3e87c3bd5253f29ccec458a0346ceb2f2df570ef Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 28 Aug 2024 20:48:01 +0800 Subject: [PATCH] Modify output messages. (#569) * Reduced output. Signed-off-by: zepan * Output the location where the modified Dockerfile file is referenced. Signed-off-by: zepan * for test Signed-off-by: zepan * Restore test file. Signed-off-by: zepan --------- Signed-off-by: zepan --- .github/workflows/pr-dockerfile-path-scan.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-dockerfile-path-scan.yaml b/.github/workflows/pr-dockerfile-path-scan.yaml index 0595e4bcb..b5e1ce753 100644 --- a/.github/workflows/pr-dockerfile-path-scan.yaml +++ b/.github/workflows/pr-dockerfile-path-scan.yaml @@ -27,7 +27,7 @@ jobs: - name: Check for changed Dockerfile paths in yaml run: | - set -xe + set -e shopt -s globstar cd ${{github.workspace}} is_use="FALSE" @@ -52,7 +52,7 @@ jobs: - name: Check for changed Dockerfile paths in readme run: | - set -xe + set -e shopt -s globstar cd ${{github.workspace}} is_use="FALSE" @@ -93,7 +93,7 @@ jobs: - name: Check for changed Dockerfile paths run: | - set -xe + set -e shopt -s globstar cd ${{github.workspace}} is_use="FALSE" @@ -102,9 +102,12 @@ jobs: changed_files="$(git diff --name-status --diff-filter=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile' | cut -f2)" if [ -n "$changed_files" ]; then for file in $changed_files; do - if grep -q "$file" ../GenAIExamples/**/*.md; then + matching_files=$(grep -rl "$file" ../GenAIExamples/**/*.md) + if [ -n "$matching_files" ]; then is_use="TRUE" used_files+="$file " + echo "Modified Dockerfile '$file' is referenced in:" + echo "$matching_files" fi done fi