Skip to content

Commit

Permalink
Fix URL check
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
aggarg committed Mar 2, 2023
1 parent 5b30456 commit 798de25
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/actions/url_verifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ function test {

for UNIQ_URL in ${!dict[@]} # loop urls
do
CURL_RES=$(curl -si --user-agent "$(USER_AGENT)" ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ')
CURL_RES=$(curl -si --user-agent "${USER_AGENT}" ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ')
RES=$?

echo "================================="
echo "Checking URL: ${UNIQ_URL}"

if [ "${CURL_RES}" == '' -o "${CURL_RES}" != '200' ]
then
echo "URL is: ${UNIQ_URL}"
echo "File names: ${dict[$UNIQ_URL]}"
if [ "${CURL_RES}" == '' ] # curl returned an error
then
CURL_RES=$RES
Expand All @@ -47,8 +48,10 @@ function test {
else
echo WARNING: Result is: "${CURL_RES}"
fi
echo "================================="
else
echo SUCCESS: Result is: "${CURL_RES}"
fi
echo "================================="
done

if [ "${SCRIPT_RET}" -eq 0 ]
Expand Down

0 comments on commit 798de25

Please sign in to comment.