Skip to content

Commit

Permalink
Add status code output
Browse files Browse the repository at this point in the history
Signed-off-by: ZePan110 <[email protected]>
  • Loading branch information
ZePan110 committed Sep 20, 2024
1 parent 35974b7 commit 47df74f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/pr-path-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
uses: actions/checkout@v4

- name: Check the Validity of Hyperlinks
# "https://intel.sharepoint.com/:v:/s/mlconsultingandsupport/EZa7vjON10ZCpMvE7U-SPMwBRXbVHqe1Ybsa-fmnXayNUA?e=f6FPsl"
# "https://intel.sharepoint.com/:v:/s/mlconsultingandsupport/ESMIcBseFTdIuqkoB7TZy6ABfwR9CkfV49TvTa1X_Jihkg?e=zMH7O7"
run: |
cd ${{github.workspace}}
fail="FALSE"
Expand All @@ -34,7 +32,7 @@ jobs:
else
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")
if [ "$response" -ne 200 ]; then
echo "**********Validation failed, try again**********"
echo "**********Validation failed, status code: $response, try again**********"
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
if [ "$response_retry" -eq 200 ]; then
echo "*****Retry successful*****"
Expand Down Expand Up @@ -105,12 +103,12 @@ jobs:
url_dev=$branch$(echo "$real_path" | sed 's|.*/docs||')
response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev")
if [ "$response" -ne 200 ]; then
echo "**********Validation failed, try again**********"
echo "**********Validation failed, status code: $response_retry, try again**********"
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url_dev")
if [ "$response_retry" -eq 200 ]; then
echo "*****Retry successful*****"
else
echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path"
echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path status code: $response_retry"
echo "$png_line"
fail="TRUE"
fi
Expand Down

0 comments on commit 47df74f

Please sign in to comment.