0
0
Fork 0
mirror of https://github.com/DavidAnson/markdownlint-cli2-action.git synced 2024-12-03 11:36:24 +01:00

Remove "command" input deprecated in v11.

This commit is contained in:
David Anson 2023-11-21 14:22:00 -08:00
parent b1a3c7b349
commit 1e5b6609c9
6 changed files with 24 additions and 147 deletions

View file

@ -1,5 +1,7 @@
CommonMark CommonMark
config config
LLMs
markdownlint-cli2-action markdownlint-cli2-action
npm
README README
truthy truthy

View file

@ -69,70 +69,6 @@ jobs:
id: test id: test
- run: exit 1 - run: exit 1
if: steps.test.outcome != 'failure' if: steps.test.outcome != 'failure'
command-config:
name: Command = config (test/errors.md, 2 errors)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm .markdownlint.json
- uses: ./
with:
command: config
globs: |
config/test.markdownlint.jsonc
test/*
continue-on-error: true
id: test
- run: exit 1
if: steps.test.outcome != 'failure'
command-config-invalid:
name: Command = config (invalid configuration file, fails)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
command: config
globs: |
invalid.markdownlint.jsonc
test/*
continue-on-error: true
id: test
- run: exit 1
if: steps.test.outcome != 'failure'
command-config-missing:
name: Command = config (missing configuration file, fails)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
command: config
continue-on-error: true
id: test
- run: exit 1
if: steps.test.outcome != 'failure'
command-fix:
name: Command = fix (test/errors.md, 0 errors)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
command: fix
globs: 'test/*'
command-unsupported:
name: Command = unsupported (fails)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
command: unsupported
continue-on-error: true
id: test
- run: exit 1
if: steps.test.outcome != 'failure'
config: config:
name: config (test/errors.md, 2 errors) name: config (test/errors.md, 2 errors)
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -13,22 +13,6 @@ information.
## Inputs ## Inputs
### command (optional)
> **Deprecated in favor of the "fix" and "config" inputs**
>
> Command to run (unset, `fix`, or `config`)
>
> If unspecified or `""`, the `markdownlint-cli2` command is run.
>
> If set to `fix`, the `markdownlint-cli2-fix` command is run and supported
> issues will be fixed automatically.
>
> If set to `config`, the `markdownlint-cli2-config` command is run and the
> first element of `globs` should specify a supported configuration file.
>
> For more detail: [documentation for `markdownlint-cli2`][command-line].
### config (optional) ### config (optional)
Path of a file to use for the base configuration object (defaults to none) Path of a file to use for the base configuration object (defaults to none)

View file

@ -5,11 +5,6 @@ branding:
icon: check-square icon: check-square
color: orange color: orange
inputs: inputs:
command:
description: Command to run (unset, "fix", or "config")
deprecationMessage: This input is deprecated in favor of the "fix" and "config" inputs
default: ''
required: false
config: config:
description: Path of a file to use for the base configuration object (defaults to none) description: Path of a file to use for the base configuration object (defaults to none)
default: '' default: ''

42
dist/index.js vendored
View file

@ -58908,37 +58908,17 @@ if (fix) {
argv.push("--fix"); argv.push("--fix");
} }
let invoke = true; const parameters = {
const command = core.getInput("command"); argv,
switch (command) { logMessage,
case "": "optionsOverride": {
// Default behavior "outputFormatters": [[outputFormatter]]
break; }
case "config": };
argv.unshift("--config"); markdownlintCli2(parameters).then(
break; (code) => code && core.setFailed(`Failed with exit code: ${code}`),
case "fix": (error) => core.setFailed(`Failed due to error: ${error}`)
argv.unshift("--fix"); );
break;
default:
core.setFailed(`Unsupported command: ${command}`);
invoke = false;
break;
}
if (invoke) {
const parameters = {
argv,
logMessage,
"optionsOverride": {
"outputFormatters": [[outputFormatter]]
}
};
markdownlintCli2(parameters).then(
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
(error) => core.setFailed(`Failed due to error: ${error}`)
);
}
})(); })();

View file

@ -60,34 +60,14 @@ if (fix) {
argv.push("--fix"); argv.push("--fix");
} }
let invoke = true; const parameters = {
const command = core.getInput("command"); argv,
switch (command) { logMessage,
case "": "optionsOverride": {
// Default behavior "outputFormatters": [[outputFormatter]]
break; }
case "config": };
argv.unshift("--config"); markdownlintCli2(parameters).then(
break; (code) => code && core.setFailed(`Failed with exit code: ${code}`),
case "fix": (error) => core.setFailed(`Failed due to error: ${error}`)
argv.unshift("--fix"); );
break;
default:
core.setFailed(`Unsupported command: ${command}`);
invoke = false;
break;
}
if (invoke) {
const parameters = {
argv,
logMessage,
"optionsOverride": {
"outputFormatters": [[outputFormatter]]
}
};
markdownlintCli2(parameters).then(
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
(error) => core.setFailed(`Failed due to error: ${error}`)
);
}