Convert glob input to globs to support multiple globs.

This commit is contained in:
David Anson
2021-01-13 14:50:05 -08:00
parent 9a43d58805
commit a7cc7f4b06
5 changed files with 16 additions and 10 deletions
+7 -1
View File
@@ -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/*
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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:
+2 -2
View File
@@ -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(
+2 -2
View File
@@ -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(