mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2024-12-24 13:53:34 +01:00
Convert glob input to globs to support multiple globs.
This commit is contained in:
parent
9a43d58805
commit
a7cc7f4b06
5 changed files with 16 additions and 10 deletions
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
|
@ -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/*
|
|
@ -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,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:
|
||||
|
|
4
dist/index.js
vendored
4
dist/index.js
vendored
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue