gaurav-nelson / github-action-markdown-link-check

Check all links in markdown files if they are alive or dead. 🔗✔️
MIT License
411 stars 76 forks source link

Feature request set base url option in github action #159

Open kouliavtsev opened 2 years ago

kouliavtsev commented 2 years ago

In my case, PREVIEW_URL changes on newly opened PR. It would be great to be able to pass the BASEURL from the github action into the github file like this.

on: [pull_request]
name: Check links for modified files
jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: gaurav-nelson/github-action-markdown-link-check@v1
      with:
        base-url: ${{ secret.PREVIEW_URL }}

This way, it could be used like this in markdown-links-config.json

{
  "replacementPatterns": [    
    {
      "pattern": "^/",
      "replacement": "{{BASEURL}}/"
    }
  ]
}
gaurav-nelson commented 6 months ago

I have stopped working on this action. Please try https://github.com/UmbrellaDocs/linkspector and https://github.com/UmbrellaDocs/action-linkspector instead. Linkspector supports base-url.