Skip to content

Commit

Permalink
Add retry for occasional failures
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 c31e3ab commit 318ad60
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/pr-path-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
for url_line in $url_lines; do
url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//')
path=$(echo "$url_line"|cut -d':' -f1 | cut -d'/' -f2-)
echo "$url"
if [[ "https://intel.sharepoint.com/:v:/s/mlconsultingandsupport/EZa7vjON10ZCpMvE7U-SPMwBRXbVHqe1Ybsa-fmnXayNUA?e=f6FPsl" == "$url" || "https://intel.sharepoint.com/:v:/s/mlconsultingandsupport/ESMIcBseFTdIuqkoB7TZy6ABfwR9CkfV49TvTa1X_Jihkg?e=zMH7O7" == "$url" ]]; then
echo "Link "$url" from ${{github.workspace}}/$path need to be verified by a real person."
else
Expand All @@ -39,8 +38,7 @@ jobs:
echo "*****Retry successful*****"
else
urls+=("$url")
echo "Invalid link from ${{github.workspace}}/$path: $url status code: $response_retry"
fail="TRUE"
echo "Status code: $response_retry, Link $url validation failed, will retry later."
fi
fi
fi
Expand All @@ -49,7 +47,12 @@ jobs:
for link in "${urls[@]}"; do
retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
echo $retry
if [ "$response_retry" -eq 200 ]; then
echo "*****Retry successful*****"
else
echo "Invalid link from ${{github.workspace}}/$path: $url status code: $retry"
fail="TRUE"
fi
done
if [[ "$fail" == "TRUE" ]]; then
Expand Down

0 comments on commit 318ad60

Please sign in to comment.