Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MikeMcC399 opened this issue Dec 12, 2022 · 3 comments
Closed

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

MikeMcC399 opened this issue Dec 12, 2022 · 3 comments

Comments

@MikeMcC399
Copy link
Collaborator

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

@MikeMcC399
Copy link
Collaborator Author

  • I will prepare a PR to resolve this issue and I will wait until issue Broken links in README #663 is resolved to avoid causing a workflow failure if main.yml is changed to fail in the case of a failed markdown link check.

@MikeMcC399
Copy link
Collaborator Author

@MikeMcC399
Copy link
Collaborator Author

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

No branches or pull requests

1 participant