Skip to content

Commit 23203b8

Browse files
ZePan110chensuyueCopilot
authored andcommitted
Blocking link checks that require a login (opea-project#1946)
Signed-off-by: ZePan110 <ze.pan@intel.com> Co-authored-by: chen, suyue <suyue.chen@intel.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: cogniware-devops <ambarish.desai@cogniware.ai>
1 parent d064b7f commit 23203b8

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/pr-link-path-scan.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,20 @@ jobs:
3636
# echo $url_line
3737
url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//')
3838
path=$(echo "$url_line"|cut -d':' -f1 | cut -d'/' -f2-)
39-
sleep $delay
40-
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")|| true
41-
if [ "$response" -ne 200 ]; then
42-
echo "**********Validation failed ($response), try again**********"
43-
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
44-
if [ "$response_retry" -eq 200 ]; then
45-
echo "*****Retry successfully*****"
46-
else
47-
echo "Invalid link ($response_retry) from ${{github.workspace}}/$path: $url"
48-
fail="TRUE"
39+
if [[ "$url" == "https://platform.openai.com/api-keys"* ]]; then
40+
echo "Link "$url" from ${{github.workspace}}/$path needs to be verified by a real person."
41+
else
42+
sleep $delay
43+
response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url")|| true
44+
if [ "$response" -ne 200 ]; then
45+
echo "**********Validation failed ($response), try again**********"
46+
response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url")
47+
if [ "$response_retry" -eq 200 ]; then
48+
echo "*****Retry successfully*****"
49+
else
50+
echo "Invalid link ($response_retry) from ${{github.workspace}}/$path: $url"
51+
fail="TRUE"
52+
fi
4953
fi
5054
fi
5155
done

0 commit comments

Comments
 (0)