reviewdog / action-markdownlint

Run markdownlint with reviewdog
MIT License
21 stars 12 forks source link

How to pass multiple parameters to markdownlint-cli? #18

Open Guts opened 3 years ago

Guts commented 3 years ago

When I write:

- name: markdownlint-github-pr-review
  uses: reviewdog/action-markdownlint@v0
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    fail_on_error: true
    filter_mode: added
    reporter: github-pr-review
    markdownlint_flags: content/**/*.md

It works.
But if I add ignore parameter, so it's failing:

- name: markdownlint-github-pr-review
  uses: reviewdog/action-markdownlint@v0
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    fail_on_error: true
    filter_mode: added
    reporter: github-pr-review
    markdownlint_flags: -i **/template_*.md content/**/*.md

it's not working? What am I missing?

skarzi commented 3 years ago

Hi,

have you checked if direct call: markdownlint -i **/template_*.md content/**/*.md works like expected? I think it's because of bash's glob expanding - it expands **/template_*.md before calling markodownlint CLI. Could you can try to escape it (at least glob passed as -i argument)? This can be done like:

-i '**/template_*.md' 'content/**/*.md'

More information - https://github.com/igorshubovych/markdownlint-cli#globbing