Validate links of private github repositories
Hi @tcort, I've running the markdown-link-checker as container image in my CI. The README.md contains some links to a private GitHub repository and throws an 404 status code, because the application tries to access unauthorized the git repository.
How can be defined a PAT to make an access possible? Alternatively, is a .netrc file supported?
https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html
Volker
I am stumbling on the same issue. We have links in our release documentation that point to releases but the link checker fails with a 404 even in the same repo where the link checker is running.
Currently i see no way on how we could authenticate to GitHub so links can be validated. A PAT token in my case is a route I am hesitate to take as this is personally bound.
A PAT token in my case is a route I am hesitate to take as this is personally bound.
Especially when it comes to validating Markdown files with links to private GitHub repositories, I think a common usage of markdown-link-check is in a GitHub Actions workflow. GitHub Actions provides an automatically generated access token for use in workflows:
https://docs.github.com/actions/security-for-github-actions/security-guides/automatic-token-authentication
It is true that this token only provides access to the repository in which the workflow is running, so this would not be sufficient to avoid false positives from markdown-link-check for links to other private repositories. However, it will be useful for validating links to the one private repository. I think that will be the most common situation anyway.
Instead of using a PAT, can't the linter be registered as a GitHub app so you can check links to private GitHub repositories?
This would solve the problem with the PAT as well as the GITHUB_TOKEN from the repository.
This issue has been marked as stale because it has been open 60 days with no activity. It will be closed in 30 days unless the stale label is removed or someone adds a comment.
Unstale
FYI: @WillGibson
Instead of using a PAT, can't the linter be registered as a GitHub app so you can check links to private GitHub repositories?
This would solve the problem with the PAT as well as the GITHUB_TOKEN from the repository.
@volker-raschek Are you able to elaborate on how this approach would work?
This issue has been marked as stale because it has been open 60 days with no activity. It will be closed in 30 days unless the stale label is removed or someone adds a comment.
unstale
@volker-raschek Are you able to elaborate on how this approach would work?
Hi @WillGibson, you register a GitHub app in your own account or an organization. You can then use the GitHub app and its token to access all repos. Renovate does a similar thing when you register the bot as a GitHub app: https://github.com/apps/renovate
https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app
This issue has been marked as stale because it has been open 60 days with no activity. It will be closed in 90 days unless the stale label is removed or someone adds a comment.
Unstale