Skip to content

Commit

Permalink
*** TESTING ONLY ***
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 1, 2024
1 parent ec07491 commit 900c462
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
name: Check URLs

on:
schedule:
- cron: '0 4 * * 2' # Tues 4:00 AM UTC
pull_request:
branches:
- bugfix-2.1.x

jobs:
check_urls:
Expand Down Expand Up @@ -35,6 +36,7 @@ jobs:
run: |
UA="Mozilla/5.0 (Linux; Android 10; SM-G996U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36"
UTMP=$(mktemp)
echo "[debug 1] UTMP = ${UTMP}"
grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \
| grep -v "Binary file" \
| sed -E "s/\/https?:\/\//\//" \
Expand All @@ -47,6 +49,7 @@ jobs:
| sort -u -R \
>"$UTMP"
echo "[debug 2] link count = $(wc -l $UTMP)"
ISERR=
declare -a BADURLS
while IFS= read -r URL
Expand Down Expand Up @@ -75,13 +78,16 @@ jobs:
fi
done <"$UTMP"
echo "[debug 3]"
if [[ -n $ISERR ]]; then
# Join bad URLs into a bulleted markdown list
printf -v BADSTR -- "- %s\n" "${BADURLS[@]}"
BODY=$(echo -e "URL Checker reports one or more URLs could not be reached:\n${BADSTR}")
echo -e "\n$BODY"
#gh issue comment 26975 --repo $GITHUB_REPOSITORY --body "${BODY}"
exit 1
else
gh issue comment 26975 --body "Comment generated by action."
fi
echo -e "\nURL Check Passed."
Expand Down

0 comments on commit 900c462

Please sign in to comment.