Description
Apart from broken links reported in issue #663, there are two other issues concerning link check errors.
- 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.
- 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
-
Execute npm run check:markdown and note "https://help.github.com/en/actions → Status: 403" which represents Forbidden
-
View for instance job 6151394979 and expand "Run npm run check:markdown".
Expected behavior
-
Running markdown-link-check should show no failures for links which work when manually used.
-
If there are failures from markdown-link-check then the action main.yml should show failure status.
Suggested fix
-
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.
-
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
Description
Apart from broken links reported in issue #663, there are two other issues concerning link check errors.
npm run check:markdownshows 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.These two issues are described here together because the solution for both is interelated.
Steps to reproduce the issue
Execute
npm run check:markdownand note "https://help.github.com/en/actions → Status: 403" which represents ForbiddenView for instance job 6151394979 and expand "Run npm run check:markdown".
Expected behavior
Running markdown-link-check should show no failures for links which work when manually used.
If there are failures from markdown-link-check then the action main.yml should show failure status.
Suggested fix
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-checkconfiguration file and implement the configuration for GitHub.Convert the script definition in
github-action/package.json
Line 16 in ced9ddd
xargsinstead ofexecas suggested in https://github.com/tcort/markdown-link-check#check-links-from-a-local-markdown-folder-recursive