markdown-link-check icon indicating copy to clipboard operation
markdown-link-check copied to clipboard

markdown-link-check exits with a status code of `0` with broken links found

Open dagardner-nv opened this issue 7 months ago • 1 comments

Issue observed with v3.13.7

bad.md:

# Bad Document

* [bad link](https://fake.url)

Repro:

$ markdown-link-check --version
3.13.7
$ markdown-link-check bad.md

FILE: bad.md
  [✖] https://fake.url

  1 links checked.

  ERROR: 1 dead links found!
  [✖] https://fake.url → Status: 0
$ echo $?
0

dagardner-nv avatar May 15 '25 18:05 dagardner-nv

Issue doesn't occur with version 3.12.2

dagardner-nv avatar May 15 '25 19:05 dagardner-nv

Also seeing this.

mieubrisse avatar Jul 01 '25 15:07 mieubrisse

Issue comes from this code https://github.com/tcort/markdown-link-check/blob/master/markdown-link-check#L305-L307

We need to return a value if dead links are found and throw it as an error to the top caller

smainil avatar Jul 22 '25 07:07 smainil

fix is already in development --> https://github.com/tcort/markdown-link-check/pull/452

smainil avatar Jul 22 '25 08:07 smainil

@smainil

  • fix is already in development --> #452

I'd really appreciate a fix for this! I just noticed today by chance that a GitHub Actions workflow had been showing a bad link in the logs for 3 months, but I never got alerted because the workflow was always showing success!

MikeMcC399 avatar Aug 21 '25 11:08 MikeMcC399

@smainil / @BaseMax

  • PR #452 appears to be stuck

Could somebody else fix this?

Without this fix markdown-link-check is essentially useless in unattended CI environments where it reports success even if there are broken links 🙁 It's not such a problem when run manually, as a human user can see the broken link report and react to it.

MikeMcC399 avatar Aug 26 '25 06:08 MikeMcC399

This issue helped me realize we probably have been missing dead links for months. Cool.

isuftin avatar Sep 19 '25 19:09 isuftin

@smainil

  • PR https://github.com/tcort/markdown-link-check/pull/452 seems to have been fixed and is now waiting for review and merge. This should be part of a new release.

MikeMcC399 avatar Sep 21 '25 08:09 MikeMcC399

@dagardner-nv

This issue was fixed through PR #452 and released with [email protected] on Oct 11, 2025.

Would you like to check if that works for you and then close this issue?

MikeMcC399 avatar Nov 10 '25 09:11 MikeMcC399

Confirmed, working thanks.

dagardner-nv avatar Nov 10 '25 18:11 dagardner-nv