Skip to content

Commit

Permalink
Merge pull request #18865 from Charan-Sharan/HPCC-32003-hyperlinks-im…
Browse files Browse the repository at this point in the history
…pl-master

HPCC-32224 Fix Unexpected End of File bug in test-hyperlinks.yml

Reviewed-By: Attila Vamos <[email protected]>
Reviewed-By: Michael Gardner <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jul 31, 2024
2 parents 220c178 + 24ce683 commit 2728e49
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/test-hyperlinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: List links from Documentation files
run: |
IFS=$'\n'
touch missingFiles.txt
for FILE in $( cat xmlFilesList.txt )
do
#check if the file is missing
Expand Down Expand Up @@ -78,12 +79,12 @@ jobs:
echo $FILE >> missingFiles.txt
continue
fi
grep -onHE -e "\]\([^\)]+" -e "\`\`\`[^\`]*" -e "http://[^\ \;\"\'\<\>\]\[\,\`\)]+" -e "https://[^\ \;\"\'\<\>\]\[\,\`\)]+" ${FILE} | sed 's/](//' > links.tmp
grep -onHE -e "\]\([^\)]+" -e "\`\`\`" -e "http://[^\ \;\"\'\<\>\,\`\)]+" -e "https://[^\ \;\"\'\<\>\,\`\)]+" ${FILE} | sed 's/](//' > links.tmp
FLAG=0
for LINE in $( cat links.tmp )
do
LINK=$( echo $LINE | cut -d ':' -f3- )
if [[ ${LINK:0:3} == '```' ]]; then
if [[ ${LINK:0:3} == "\`\`\`" ]]; then
FLAG=$(( 1 - FLAG ))
continue
fi
Expand Down Expand Up @@ -215,16 +216,26 @@ jobs:
echo -e "Broken links: \n" > error-report.log
cat error-reportTmp.log >> error-report.log
else
echo -e "Missing Files: \n" > error-report.log
cat missingFiles.txt >> error-report.log
echo -e "Broken links: \n" >> error-report.log
echo -e "Missing Files:" > error-report.log
FILE_COUNT=1
for FILE in $( cat missingFiles.txt )
do
echo -e "${FILE_COUNT}. ${FILE}" >> error-report.log
FILE_COUNT=$(( FILE_COUNT + 1 ))
done
echo -e "\nBroken links: \n" >> error-report.log
cat error-reportTmp.log >> error-report.log
fi
if [[ ${{ github.event_name }} == "pull_request" || ${{ inputs.Debug-Mode }} == false ]]; then
if [ -z ${{ inputs.Debug-Mode }} ]; then
DEBUG_MODE=false
else
DEBUG_MODE=${{ inputs.Debug-Mode }}
fi
if [[ ${{ github.event_name }} == "pull_request" || $DEBUG_MODE == false ]]; then
rm -rf *FilesList.txt \
checkedLinksCache.txt \
*Links.txt \
linksList.txt \
linksList.txt
fi
- name: Upload logs
Expand Down

0 comments on commit 2728e49

Please sign in to comment.