Skip to content

Commit

Permalink
ci: Show linkcheck broken links in job output (canonical#4670)
Browse files Browse the repository at this point in the history
If links succeed locally but fail in GH actions, what else can one do?

Increment link failure, since linkcheck doesn't understand GH markdown page
anchors.
  • Loading branch information
holmanb committed Dec 13, 2023
1 parent d29b744 commit addfc84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ jobs:
- name: Check for broken links below threshold
run: |
broken_count=$(grep -c "broken" output.txt)
if [[ $broken_count -ge 5 ]]; then
if [[ $broken_count -ge 6 ]]; then
echo "Too many broken links detected: $broken_count"
broken_matches=$(grep "broken" output.txt)
echo "Broken links \n$broken_matches"
exit 1
else
echo "Number of broken links is below threshold: $broken_count"
Expand Down

0 comments on commit addfc84

Please sign in to comment.