Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple files #41

Closed
koppor opened this issue May 28, 2020 · 6 comments
Closed

Add support for multiple files #41

koppor opened this issue May 28, 2020 · 6 comments

Comments

@koppor
Copy link

koppor commented May 28, 2020

Checking a whole repository takes much time.

markdown lint CLI solved that as follows:

markdownlint --help

  Usage: markdownlint [options] <files|directories|globs>

Would it be possible to also support multiple parameters to the action? In my concrete case, I would like to check README.md, CHANGELOG.md, and docs/ in one run.

koppor added a commit to JabRef/jabref that referenced this issue May 28, 2020
@gaurav-nelson
Copy link
Owner

@koppor

Currently, when we specify any folder using the folder-path option, it gets inserted into the find command as
find <folder-path-value> -name "*.<extension>".

You can use the folder-path option to include additional folders. For adding additional files you can specify folder-path value as:

docs -iwholename "full/path/to/README.md" -o -iwholename "full/path/to/CHANGELOG.md" -o
  • it must end with -o to complete the command.

so the final command that executes will be:

find docs -iwholename "full/path/to/README.md" -o -iwholename "full/path/to/CHANGELOG.md" -o -name "*.md" -not -path './node_modules/*' -exec markdown-link-check '{}' --config mlc_config.json -q ';'

Let me know if that works for you. If it does, I can document this option in the docs and close this issue.

@koppor
Copy link
Author

koppor commented Jul 28, 2020

I tried it at

The call adds ' around:

find 'docs/ -iwholename CHANGELOG.md -o -iwholename README.md -o' -name '*.md' -not -path './node_modules/*' -exec markdown-link-check '{}' --config mlc_config.json -q ';'

See JabRef/jabref#6720

@gaurav-nelson
Copy link
Owner

@koppor Can you check if the following commit resolves this issue?

uses: gaurav-nelson/github-action-markdown-link-check@80c4ed4945081c1c6d1957487d53278aa347b76c

PS: https://github.com/gaurav-nelson/github-action-markdown-link-check#check-multiple-directories-and-files

I'll release a new version if that works well.

@koppor
Copy link
Author

koppor commented Aug 18, 2020

Works! Thank you!

The documentation should mentation that ./ in front of filenames is really important. Without that, it does not work.

Long test report:

I configured the output as follows:

      - uses: gaurav-nelson/github-action-markdown-link-check@master
        with:
          use-quiet-mode: 'yes'
          use-verbose-mode: 'no'
          config-file: 'mlc_config.json'
          folder-path: 'docs/'
          file-path: './CHANGELOG.md, ./README.md'

The call is as follows:

+ find docs/ -name '*.md' -not -path './node_modules/*' -exec markdown-link-check '{}' --config mlc_config.json -q ';'
+ set +x
+ find . -type f '(' -wholename ./CHANGELOG.md -o -wholename ./README.md ')' -not -path './node_modules/*' -exec markdown-link-check '{}' --config mlc_config.json -q ';'
+ set +x

The output is as follows:

+ set +x
=========================> MARKDOWN LINK CHECK <=========================

FILE: docs/readings-on-coding/tools.md

17 links checked.

...


FILE: ./CHANGELOG.md

300 links checked.

FILE: ./README.md

41 links checked.

=========================================================================

@koppor
Copy link
Author

koppor commented Aug 18, 2020

May I ask for a new release tag? 😇

@gaurav-nelson
Copy link
Owner

I'll bump it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants