Treat "fix" input as a boolean via getBooleanInput, update documentation (refs #366).

This commit is contained in:
David Anson
2026-05-16 17:33:08 -07:00
parent ded1f9488f
commit c643cd59b9
5 changed files with 25 additions and 11 deletions
+15 -2
View File
@@ -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
+5 -4
View File
@@ -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
View File
@@ -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:
+1 -1
View File
@@ -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");
}
+1 -1
View File
@@ -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");
}