mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2026-06-30 23:19:41 +02:00
Treat "fix" input as a boolean via getBooleanInput, update documentation (refs #366).
This commit is contained in:
@@ -126,8 +126,8 @@ jobs:
|
||||
id: test
|
||||
- run: exit 1
|
||||
if: steps.test.outcome != 'failure'
|
||||
fix:
|
||||
name: fix (test/errors.md, 0 errors)
|
||||
fix-true:
|
||||
name: fix-true (test/errors.md, 0 errors)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
@@ -135,6 +135,19 @@ jobs:
|
||||
with:
|
||||
fix: true
|
||||
globs: 'test/*.md'
|
||||
fix-false:
|
||||
name: fix-false (test/errors.md, 3 errors)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: ./
|
||||
with:
|
||||
fix: false
|
||||
globs: 'test/*.md'
|
||||
continue-on-error: true
|
||||
id: test
|
||||
- run: exit 1
|
||||
if: steps.test.outcome != 'failure'
|
||||
rules-pass:
|
||||
name: custom rules (README.md, 0 errors)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -30,16 +30,17 @@ and passing the specified JSON Pointer.
|
||||
|
||||
### fix (optional)
|
||||
|
||||
Whether to fix supported issues automatically (any truthy value enables)
|
||||
Whether to fix supported issues automatically (`true`/`false`, defaults to
|
||||
`false`)
|
||||
|
||||
Equivalent to specifying the `--fix` [command-line option][command-line].
|
||||
|
||||
### globs (optional)
|
||||
|
||||
Glob expression(s) of files to lint (newline-delimited by default)
|
||||
Glob expression(s) of files to lint (newline-delimited, defaults to
|
||||
`*.{md,markdown}`)
|
||||
|
||||
The default `*.{md,markdown}` lints all Markdown files in the base directory of
|
||||
a project.
|
||||
The default lints all Markdown files in the base directory of a project.
|
||||
|
||||
For more detail: [glob syntax in `markdownlint-cli2`][glob-syntax].
|
||||
|
||||
|
||||
+3
-3
@@ -14,11 +14,11 @@ inputs:
|
||||
default: ''
|
||||
required: false
|
||||
fix:
|
||||
description: Whether to fix supported issues automatically (any truthy value enables)
|
||||
default: ''
|
||||
description: Whether to fix supported issues automatically ("true"/"false", defaults to "false")
|
||||
default: 'false'
|
||||
required: false
|
||||
globs:
|
||||
description: Glob expression(s) of files to lint (newline-delimited)
|
||||
description: Glob expression(s) of files to lint (newline-delimited, defaults to "*.{md,markdown}")
|
||||
default: '*.{md,markdown}'
|
||||
required: false
|
||||
separator:
|
||||
|
||||
Vendored
+1
-1
@@ -81159,7 +81159,7 @@ const configPointer = getInput("configPointer");
|
||||
if (configPointer) {
|
||||
argv.push("--configPointer", configPointer);
|
||||
}
|
||||
const fix = Boolean(getInput("fix"));
|
||||
const fix = Boolean(getBooleanInput("fix"));
|
||||
if (fix) {
|
||||
argv.push("--fix");
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ const configPointer = core.getInput("configPointer");
|
||||
if (configPointer) {
|
||||
argv.push("--configPointer", configPointer);
|
||||
}
|
||||
const fix = Boolean(core.getInput("fix"));
|
||||
const fix = Boolean(core.getBooleanInput("fix"));
|
||||
if (fix) {
|
||||
argv.push("--fix");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user