Skip to content

Validate links of private github repositories #351

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

Open
volker-raschek opened this issue Jul 22, 2024 · 6 comments
Open

Validate links of private github repositories #351

volker-raschek opened this issue Jul 22, 2024 · 6 comments

Comments

@volker-raschek
Copy link

volker-raschek commented Jul 22, 2024

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

@mpas
Copy link

mpas commented Feb 27, 2025

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.

@per1234
Copy link

per1234 commented Feb 27, 2025

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 allow avoid false positives from markdown-link-check for links to other private repositories. However, it will be useful in cases where there are only links to the one private repository.

@volker-raschek
Copy link
Author

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.

Copy link

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.

@github-actions github-actions bot added the Stale label Apr 30, 2025
@volker-raschek
Copy link
Author

Unstale

FYI: @WillGibson

@WillGibson
Copy link
Collaborator

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?

@github-actions github-actions bot removed the Stale label May 4, 2025
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

4 participants