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

Feature: Add exclude parameter

Open ruzickap opened this issue 5 years ago • 6 comments
trafficstars

Hello

Would it be possible to add the exclude parameter, which will skip the checks for certain files?

    - uses: gaurav-nelson/github-action-markdown-link-check@v1
      with:
        use-verbose-mode: 'yes'
        config-file: 'mlc_config.json'
        exclude: "CHANGELOG.md"
        #or maybe better - set the find command parameters:
        #exclude: '-not -path ./node_modules/*'
        #exclude: '-not -name CHANGELOG.md'

Thank you

ruzickap avatar May 08 '20 16:05 ruzickap

Thanks @ruzickap yes it makes sense. I'll take this one next.

gaurav-nelson avatar May 08 '20 23:05 gaurav-nelson

@ruzickap I've had some success with replacing find with fd. fd allows an .fdignore file https://github.com/sharkdp/fd#excluding-specific-files-or-directories

What do you think about not adding another option to exclude files and folder, instead recommending users to create an ./.fdignore file to skip specific files and folders?

gaurav-nelson avatar Jan 23 '21 10:01 gaurav-nelson

I'm not sure if it's good idea to add some files (.fdignore) into the repository only to exclude the files during tests. I would prefer to have variable and optionally .fdignore to exclude files from being "tested".

Maybe others have different opinion about it...

ruzickap avatar Jan 23 '21 11:01 ruzickap

I would second that @ruzickap . The approach with .fdignore could lead to conflicts if another action also uses fd but you want to ignore (or not) different paths. Excluded files should preferably be limited to the individual action.

musicEnfanthen avatar Jan 23 '21 13:01 musicEnfanthen

Thanks @ruzickap @musicEnfanthen for your inputs. I'll add it as a variable.

gaurav-nelson avatar Jan 24 '21 02:01 gaurav-nelson

Hi,

Is this still planned to be added?

We are trying to use this action and we want to exclude one of the directories in our project but due to not being able to specify exclusions this makes us need to explicitly define the files and directories we want to use to avoid the undesired directory. This is not ideal as if there are new files and directories that contain .md files in the future one needs to remember adding it to the list which is easy to forget.

I would suggest adding a parameter to ignore a set of files, and a parameter to ignore a set of directories recursively. This is similarly to what's been done for inclusions.

Thank you

miguelsorianod avatar Apr 12 '23 17:04 miguelsorianod