File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,17 @@ jobs:
3131
3232 - name : Annotate Results
3333 run : |
34- if grep -q "✖" link-check-results.txt; then
34+ # Extract broken links
35+ broken_links=$(grep -B 1 "✖" link-check-results.txt || true)
36+
37+ if [ -n "$broken_links" ]; then
3538 echo "::error title=Broken Links Found::The following links are broken:"
36- grep -B 1 "✖" link-check-results.txt | sed 's/%/%25/g; s/\n/%0A/g; s/\r/%0D/g'
37- echo "Full Details:"
38- cat link-check-results.txt | grep -B 1 "✖"
39+ echo "$broken_links" | sed 's/%/%25/g; s/\n/%0A/g; s/\r/%0D/g'
40+
41+ # Print broken links in console for debugging
42+ echo "Broken Links Details:"
43+ echo "$broken_links"
44+
3945 exit 1
4046 else
4147 echo "::notice title=All Links Valid::All links in the README are valid."
You can’t perform that action at this time.
0 commit comments