Skip to content

Commit

Permalink
Optimize code structure
Browse files Browse the repository at this point in the history
Signed-off-by: ZePan110 <ze.pan@intel.com>
  • Loading branch information
ZePan110 committed Sep 24, 2024
1 parent 4cf137b commit 7a4867b
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/pr-path-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,9 @@ jobs:
else
check_path=${{github.workspace}}/$(dirname "$refer_path")/$png_path
fi
real_path=$(realpath $check_path)
if [ $? -ne 0 ]; then
echo "${{github.workspace}}/$refer_path:$png_path does not exist"
fail="TRUE"
fi
if [[ "$png_line" == *#* ]]; then
if [ -e "$real_path" ]; then
if [ -e "$check_path" ]; then
real_path=$(realpath $check_path)
if [[ "$png_line" == *#* ]]; then
if [ -n "changed_files" ] && echo "$changed_files" | grep -q "^${real_path}$"; then
url_dev=$branch$(echo "$real_path" | sed 's|.*/GenAIExamples||')$png_path
response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev")
Expand All @@ -153,18 +149,13 @@ jobs:
fail="TRUE"
fi
else
echo "Validation succeed $png_line"
echo "Validation succeed $png_line"
fi
fi
else
echo "$real_path could not be found."
fail="TRUE"
fi
else
if [ ! -e "$real_path" ]; then
echo "$png_path referenced in file $refer_path could not be found."
fail="TRUE"
fi
echo "${{github.workspace}}/$refer_path:$png_path does not exist"
fail="TRUE"
fi
done
fi
Expand Down

0 comments on commit 7a4867b

Please sign in to comment.