Skip to content

Commit

Permalink
Updated the error log file format
Browse files Browse the repository at this point in the history
Signed-off-by: Charan-Sharan <[email protected]>
  • Loading branch information
Charan-Sharan committed Jun 21, 2024
1 parent 505130d commit 95ff629
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/test-hyperlinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
done
for file in $( cat mdFilesList.txt )
do
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
Expand Down Expand Up @@ -152,6 +152,7 @@ jobs:
fi
fi
done
- name: report Error links
run: |
Number_of_404_links=$( cat error-report.log | wc -l )
Expand All @@ -167,21 +168,22 @@ jobs:
- name: Modify Log file
if: ${{ failure() || cancelled() }}
run: |
baseDir=${PWD/$(basename $PWD)}
baseDir=${PWD%$(basename $PWD)}
baseDir=$(echo $baseDir | sed 's/\//\\\//g')
sed -i "s/${baseDir}//g" error-report.log
fileNames=$(cat Temp/BrokenLinks.txt | cut -d ':' -f1 | sort | uniq )
fileNames=$(cat error-report.log | cut -d ':' -f1 | sort | uniq )
fileCount=1
for line in $fileNames
do
rawLines=$( cat Temp/BrokenLinks.txt | grep $line | cut -d ':' -f2- )
echo "$fileCount. $line" >> Broken-links.log
rawLines=$( cat error-report.log | grep $line | cut -d ':' -f2- )
echo "$fileCount. $line" >> error-reportTmp.log
fileCount=$(( fileCount + 1))
for rawLine in $rawLines
do
echo -e "\t Line $rawLine" | sed 's/:/ : /' >> Broken-links.log
echo -e "\t Line $rawLine" | sed 's/:/ : /' >> error-reportTmp.log
done
done
cat error-reportTmp.log > error-report.log
- name: Upload logs
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 95ff629

Please sign in to comment.