Cypress: Automate checking broken links in our Markdown files

Created on 11 Feb 2020  ยท  2Comments  ยท  Source: cypress-io/cypress

In #6373 @CypressCecelia has noted that several links are broken in the contributing guide markdown. We need to automatically check for broken links on CI

Here is a good tool to do this: https://github.com/tcort/markdown-link-check

Here is how it finds those broken links

Screen Shot 2020-02-11 at 3 03 18 PM

Complication: some of our urls are internal links to private repos, so we need to handle that somehow

ERROR: 4 dead links found!
[โœ–] https://circleci.com/gh/cypress-io/cypress-on โ†’ Status: 404
[โœ–] https://github.com/cypress-io/cypress-on โ†’ Status: 404
[โœ–] https://circleci.com/gh/cypress-io/docsearch-scraper โ†’ Status: 404
[โœ–] https://github.com/cypress-io/docsearch-scraper โ†’ Status: 404

Second complication

$ npx markdown-link-check ./README.md --quiet
npx: installed 66 in 3.692s

FILE: ./README.md
[โœ–] /LICENSE

14 links checked.

ERROR: 1 dead links found!
[โœ–] /LICENSE โ†’ Status: 400

where we used the following in Markdown

[MIT license](/LICENSE)
first-timers-only build chore

Most helpful comment

I respectfully disagree. @CypressCecelia just hit it, blocking her a little bit. Our users would be blocked when hitting a dead link, and our docs are our best part in my opinion, so we should keep this way. Automating link checks is sooooo easy and once automated, they should not go bad

All 2 comments

This is super low priority. Almost not worth the development time imo. What happens if a markdown link is broken? We're going to fail the whole build? That would not be ideal.

I respectfully disagree. @CypressCecelia just hit it, blocking her a little bit. Our users would be blocked when hitting a dead link, and our docs are our best part in my opinion, so we should keep this way. Automating link checks is sooooo easy and once automated, they should not go bad

Was this page helpful?
0 / 5 - 0 ratings