laminas-continuous-integration-action icon indicating copy to clipboard operation
laminas-continuous-integration-action copied to clipboard

Add automated link checker

Open froschdesign opened this issue 4 years ago • 6 comments

Feature Request

Beside the Markdown linting it would be great if we can check all the links in the Markdown files.

Q A
New Feature yes
BC Break no

Summary

A potential candidate would be markdown-link-check which can be installed via npm.

froschdesign avatar Apr 26 '21 19:04 froschdesign

Related to https://github.com/laminas/documentation/issues/16

froschdesign avatar Aug 01 '21 08:08 froschdesign

This tool doesn't support globbing, but I managed to run it out of docker with find with something like find ./docs/book -name \*.md -exec docker run -v ${PWD}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/{} \;

Because it's one file per run, there's no overall return and getting the output into GHA will be interesting.

Not sure how to proceed with this…

gsteel avatar Dec 16 '22 13:12 gsteel

@gsteel Thank you for the testing. 👍🏻

Maybe this one: https://github.com/marketplace/actions/lychee-broken-link-checker

froschdesign avatar Dec 16 '22 14:12 froschdesign

That's more like it. For i18n:

lychee docs/book -f json
{
  "total": 62,
  "successful": 61,
  "failures": 1,
  "unknown": 0,
  "timeouts": 0,
  "redirects": 0,
  "excludes": 0,
  "errors": 0,
  "cached": 0,
  "fail_map": {
    "docs/book/view-helpers/plural.md": [
      {
        "url": "https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals",
        "status": "Failed: Network error"
      }
    ]
  }
}

gsteel avatar Dec 16 '22 14:12 gsteel

It's also a lot faster…

gsteel avatar Dec 16 '22 14:12 gsteel

@gsteel Is this an option for us: https://github.com/marketplace/actions/lychee-broken-link-checker ?

froschdesign avatar Feb 22 '23 20:02 froschdesign