Skip to content

Commit 9eea7bb

Browse files
authored
Update broken-links.yml
1 parent 33794a2 commit 9eea7bb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/broken-links.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ jobs:
2424
- name: Check README links
2525
id: check-links
2626
run: |
27-
markdown-link-check README.md > link-check-results.txt || true
27+
markdown-link-check --verbose README.md > link-check-results.txt || true
28+
echo "::group::Link Check Results"
29+
cat link-check-results.txt
30+
echo "::endgroup::"
2831
2932
- name: Annotate Results
3033
run: |
31-
if grep -q "ERROR" link-check-results.txt; then
32-
echo "::error title=Broken Links Found::$(cat link-check-results.txt | sed 's/%/%25/g; s/\n/%0A/g; s/\r/%0D/g')"
34+
if grep -q "ERROR:" link-check-results.txt; then
35+
echo "::error title=Broken Links Found::$(cat link-check-results.txt | grep -B 2 'ERROR' | sed 's/%/%25/g; s/\n/%0A/g; s/\r/%0D/g')"
36+
echo "Broken Links:"
37+
cat link-check-results.txt | grep -B 2 'ERROR'
38+
exit 1
3339
else
3440
echo "::notice title=No Broken Links Found::All links are valid in the README."
3541
fi

0 commit comments

Comments
 (0)