diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eae9085..65fddec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,4 +18,10 @@ jobs: - name: One glob (test/error.md, errors) uses: ./ with: - glob: test/errors.md + globs: test/errors.md + - name: Two globs (README.md and test/error.md, errors) + uses: ./ + with: + globs: | + *.md + test/* \ No newline at end of file diff --git a/README.md b/README.md index 5c36aaf..4756df5 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ Markdown/CommonMark files with the markdownlint library ## Inputs -### glob (optional) +### globs (optional) -Glob expression of files to lint +Glob expression(s) of files to lint (newline-delimited) -Default: `*.{md,markdown}` +The default `*.{md,markdown}` lints all Markdown files in the base directory ## Outputs diff --git a/action.yml b/action.yml index 58e8f7c..22a9e28 100644 --- a/action.yml +++ b/action.yml @@ -2,8 +2,8 @@ name: 'markdownlint-cli2-action' author: 'David Anson' description: 'A GitHub Action to run the markdownlint-cli2 tool for linting Markdown/CommonMark files with the markdownlint library' inputs: - glob: - description: 'Glob expression of files to lint' + globs: + description: 'Glob expression(s) of files to lint (newline-delimited)' default: '*.{md,markdown}' required: false runs: diff --git a/dist/index.js b/dist/index.js index f01c175..6b34e30 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16,10 +16,10 @@ const { "main": markdownlintCli2 } = __nccwpck_require__(9202); const logMessage = core.info; const logError = core.error; -const glob = core.getInput("glob"); +const argv = core.getInput("globs").split("\n").filter(String)); markdownlintCli2({ - "argv": [ glob ], + argv, logMessage, logError }).then( diff --git a/markdownlint-cli2-action.js b/markdownlint-cli2-action.js index eca2dd2..f9644b2 100644 --- a/markdownlint-cli2-action.js +++ b/markdownlint-cli2-action.js @@ -7,10 +7,10 @@ const { "main": markdownlintCli2 } = require("markdownlint-cli2"); const logMessage = core.info; const logError = core.error; -const glob = core.getInput("glob"); +const argv = core.getInput("globs").split("\n").filter(String)); markdownlintCli2({ - "argv": [ glob ], + argv, logMessage, logError }).then(