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

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

folder-path is ignored #24

Closed philsturgeon closed 4 years ago

philsturgeon commented 4 years ago

Using the following action:

name: Check Markdown Links

on:
  pull_request:
    branches:
      - master
      - develop

jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        folder-path: "./docs/"
    - uses: gaurav-nelson/github-action-markdown-link-check@master

I would expect only the docs/ folder to be checked, but it goes ahead and checks all .md files anyway:

FILE: ./.github/CODE_OF_CONDUCT.md
[✓] https://github.com/stoplightio/code-of-conduct/blob/master/incident-reporting.md
[✓] https://github.com/stoplightio/code-of-conduct/blob/master/long-form-code-of-conduct.md#long-form-code-of-conduct

2 links checked.

FILE: ./CHANGELOG.md
[✓] https://keepachangelog.com/en/1.0.0/
[✓] https://semver.org/spec/v2.0.0.html
[✓] https://github.com/stoplightio/spectral/issues/747
[✓] https://github.com/stoplightio/spectral/pull/1011
[✓] https://github.com/stoplightio/spectral/pull/1009
[✓] https://github.com/stoplightio/spectral/issues/725
[✓] https://github.com/stoplightio/spectral/pull/706
[✖] https://github.com/stoplightio/spectral/issues/585
[✖] https://github.com/stoplightio/spectral/pull/719
[✖] https://github.com/stoplightio/spectral/pull/685
[✖] https://github.com/stoplightio/spectral/pull/839
[✖] https://github.com/stoplightio/spectral/pull/867
[✖] https://github.com/stoplightio/spectral/pull/652
[✖] https://github.com/stoplightio/json-ref-resolver/pull/141
[✖] https://github.com/stoplightio/json-ref-resolver/pull/146
[✖] https://github.com/stoplightio/json-ref-resolver/pull/140
[✖] https://github.com/stoplightio/json-ref-resolver/pull/147
[✖] https://github.com/stoplightio/spectral/issues/679
[✖] https://github.com/stoplightio/spectral/issues/751
[✖] https://github.com/stoplightio/spectral/pull/846
[✖] https://github.com/stoplightio/spectral/pull/824
[✖] https://github.com/stoplightio/spectral/issues/680
[✖] https://github.com/stoplightio/spectral/pull/737

I am adding in some comments to turn it off and back on again in the changelog, but I'd prefer to be able to use this handy feature.

If you've got a buy me a coffee button or wanna add a Treeware button I'll be happy to throw a few in. :)

gaurav-nelson commented 4 years ago

Thanks @philsturgeon

Instead of using folder-path: "./docs/" can you please try folder-path: "docs"?

Thanks for the ☕️ offer, I'll look into the Treeware 🌳 thingy.

gaurav-nelson commented 4 years ago

I tried this in https://github.com/stoplightio/spectral/pull/1041 but looks like its a bug. I'll look into this one.

gaurav-nelson commented 4 years ago

🤦‍♂ 😷

@philsturgeon

instead of:

- uses: actions/checkout@master
      with:
        folder-path: "./docs/"

it should be:

- uses: gaurav-nelson/github-action-markdown-link-check@master
      with:
        folder-path: 'docs'

PS: https://github.com/stoplightio/spectral/pull/1047/checks?check_run_id=548616805#step:4:14