github-action-markdown-link-check
github-action-markdown-link-check copied to clipboard
How to verify links to other private repos
I have 2 private repos with documentation. RepositoryA has a .md file with a link to a .md file in RepositoryB. GitHub actions in RepositoryA by default doesn't have access to RepositoryB. Is there a way to achieve this?
Thank you @dvdstelt
I'm not 100% sure if it will work or if there are any security implications of using this approach.
- Maybe you can use
GITHUB_TOKEN(https://docs.github.com/en/actions/reference/authentication-in-a-workflow) with thehttpHeadersandurlsoptions in yourconfig.jsonfile.
@dvdstelt Is this still an issue? Were you able to address it?
- If yes, can you share the configuration? I can maybe add it as an example in the README.
It needs to be a code change, not possible via config alone, from what I can see.
@dvdstelt when you say:
RepositoryA has a .md file with a link to a .md file in RepositoryB
Is it a hyperlink?
It is indeed a hyperlink. In my case to a different repo in within the same organization.
I would love to see that feature!
Any updates on your end @gaurav-nelson ?
It looks like you can't use the value ${{ secrets.GITHUB_TOKEN }} inside the .json file for the markdown link config file. I would like to have this feature as our README.md file in our private repo, links to documentation found on our wiki page in our private repo. We also have the same issue where we reference other private repositories too.
Hi!
I would also be in need of that feature! My organization links https://github.com/<organization> are all failing.
I feel like this could be resolved by providing a template for the mlc_config.json to resolve the github_token in the Authorization header.
{
"httpHeaders": [
{
"urls": ["https://github.com/<organization>"],
"headers": {
"Authorization": "Bearer ${{ secrets.GITHUB_TOKEN }}"
}
}
]
}