Skip to content

Conversation

@kt3k
Copy link
Contributor

@kt3k kt3k commented May 6, 2025

The CLI used to return exit code 1 when dead links found until version 3.12.2, but it changed to exit code 0 in this commit (This seems unintentional as the behavior change not mentioned)

This PR change the exit code back to the original (1) when there are dead links.

@BaseMax
Copy link
Collaborator

BaseMax commented May 6, 2025

cc @dudeofawesome
cc @tcort

d8f522b


if (err) throw null;
else if (results.some((result) => result.status === 'dead')) return;
else if (results.some((result) => result.status === 'dead')) throw null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have enabled the workflows. I'm hoping a test will fail as a result of this change. If not, we should add one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll try to add some test case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test cases dc70b82

@mieubrisse
Copy link

Hey folks, I'm also struggling with this regression where it returns 0 even when dead links are found. It seems like the failing tests have to do with the return code:

Screenshot 2025-07-02 at 10 06 08

@kt3k any clue if this is related to your change?

@kt3k
Copy link
Contributor Author

kt3k commented Jul 4, 2025

pushed a potential fix f551875

@mieubrisse
Copy link

mieubrisse commented Jul 4, 2025

Thanks a ton @kt3k !

@WillGibson can we get the workflows run to see if this fixed the CI?

@smainil
Copy link
Collaborator

smainil commented Jul 22, 2025

@kt3k any chance you can fix the tests ?

@kt3k
Copy link
Contributor Author

kt3k commented Sep 8, 2025

Hey, sorry for the delay. I updated the test cases to pass them on windows. Please run the CI again

(Note: I experimented the windows run in kt3k/markdown-link-check-clone#1 )

@MikeMcC399
Copy link
Contributor

This is a critical fix, restoring functionality that makes markdown-link-check usable once again in unattended CI workflows.

Please review with priority and merge!

cc: @tcort @WillGibson @BaseMax @smainil

@MikeMcC399
Copy link
Contributor

@tcort

You've cut a new release v3.14.0, however the critical fix in this PR was not merged and included.

Until this issue is fixed, markdown-link-check remains of very limited value in unattended CI workflows, since it always returns success, thus failing its primary duty of reporting link errors to the calling process if it finds any link errors.

Please take a look here and see if you could merge this PR soon and cut a new patch release to follow on from v3.14.0.

@tcort tcort merged commit 2913ff1 into tcort:master Oct 11, 2025
12 checks passed
@tcort
Copy link
Owner

tcort commented Oct 11, 2025

merged + published in v3.14.1

@MikeMcC399
Copy link
Contributor

@tcort - Thank you! Installed and now working perfectly again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants