github-action-markdown-link-check icon indicating copy to clipboard operation
github-action-markdown-link-check copied to clipboard

How to verify links to other private repos

Open dvdstelt opened this issue 4 years ago • 11 comments
trafficstars

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?

dvdstelt avatar Jun 30 '21 11:06 dvdstelt

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 the httpHeaders and urls options in your config.json file.

gaurav-nelson avatar Jul 01 '21 00:07 gaurav-nelson

@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.

gaurav-nelson avatar Aug 19 '21 00:08 gaurav-nelson

It needs to be a code change, not possible via config alone, from what I can see.

dvdstelt avatar Aug 19 '21 08:08 dvdstelt

@dvdstelt when you say:

RepositoryA has a .md file with a link to a .md file in RepositoryB

Is it a hyperlink?

gaurav-nelson avatar Aug 19 '21 23:08 gaurav-nelson

It is indeed a hyperlink. In my case to a different repo in within the same organization.

dvdstelt avatar Aug 20 '21 10:08 dvdstelt

I would love to see that feature!

fharper avatar Dec 10 '21 14:12 fharper

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.

khanguslee avatar Sep 13 '22 03:09 khanguslee

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 }}"
      }
    }
  ]
}

gbmarc1 avatar Oct 18 '22 19:10 gbmarc1