Skip to content

markdown-link-check produces wrong results and exit status #664

@MikeMcC399

Description

@MikeMcC399

Description

Apart from broken links reported in issue #663, there are two other issues concerning link check errors.

  1. Running npm run check:markdown shows 403 link errors for links to the github.com domain although when the links are used manually they work, for example https://help.github.com/en/actions which opens https://docs.github.com/en/actions.
  2. Although the markdown check reports link errors, the ci action main.yml shows success.

These two issues are described here together because the solution for both is interelated.

Steps to reproduce the issue

  1. Execute npm run check:markdown and note "https://help.github.com/en/actions → Status: 403" which represents Forbidden

  2. View for instance job 6151394979 and expand "Run npm run check:markdown".

Expected behavior

  1. Running markdown-link-check should show no failures for links which work when manually used.

  2. If there are failures from markdown-link-check then the action main.yml should show failure status.

Suggested fix

  1. See https://github.com/gaurav-nelson/github-action-markdown-link-check#github-links-failure-fix for a suggested configuration file which mitigates the 403 forbidden errors when checking github.com domain links. Create a markdown-link-check configuration file and implement the configuration for GitHub.

  2. Convert the script definition in

    "check:markdown": "find *.md -exec npx markdown-link-check {} \\;",
    to use xargs instead of exec as suggested in https://github.com/tcort/markdown-link-check#check-links-from-a-local-markdown-folder-recursive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions