UmbrellaDocs / action-linkspector

Uncover broken links in your content using Linkspector GitHub action.
MIT License
11 stars 2 forks source link

Remove false negative for Organization Private repositories #15

Closed jatin-mehrotra-colorkrew closed 3 months ago

jatin-mehrotra-colorkrew commented 3 months ago

Is your feature request related to a problem? Please describe.

I have an organization which has private repositories. We use wiki for maintaining our documentation and we link many repositories in our documentation. While running this GHA it also flags working links ( private repository of my organizations)

Describe the solution you'd like

My organization private repository should not be flagged

Describe alternatives you've considered

NA

Additional context

Code I am using

  check-links:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run linkspector
        uses: umbrelladocs/action-linkspector@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          fail_on_error: true
          config_file: '.github/ci-check-configs/.linkspector.yml'
jatin-mehrotra-colorkrew commented 3 months ago

@gaurav-nelson Can you look into this.

gaurav-nelson commented 3 months ago

You can use ignorePatterns in your configuration to ignore the links to your private repositories. PS: https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#ignore-patterns

jatin-mehrotra-colorkrew commented 3 months ago

@gaurav-nelson

Is there a way to check Private repositories using this GHA?

gaurav-nelson commented 3 months ago

Unfortunately, Linkspector doesn't have that functionality yet. Please feel free to create new feature request.

For now, you can try, markdown-link-check with httpHeaders option PS: https://github.com/tcort/markdown-link-check?tab=readme-ov-file#markdownlinkcheckmarkdown-opts-callback

"httpHeaders": [
    {
      "urls": ["https://example.com"],
      "headers": {
        "Authorization": "Basic Zm9vOmJhcg==",
        "Foo": "Bar"
      }
    }
  ],

Create a personal access token on GitHub and then use it with Authorization. Make sure to not upload the file to GitHub with your token in it. 😄