mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2024-11-21 13:51:28 +01:00
Remove "command" input deprecated in v11.
This commit is contained in:
parent
b1a3c7b349
commit
1e5b6609c9
6 changed files with 24 additions and 147 deletions
2
.github/dictionary.txt
vendored
2
.github/dictionary.txt
vendored
|
@ -1,5 +1,7 @@
|
||||||
CommonMark
|
CommonMark
|
||||||
config
|
config
|
||||||
|
LLMs
|
||||||
markdownlint-cli2-action
|
markdownlint-cli2-action
|
||||||
|
npm
|
||||||
README
|
README
|
||||||
truthy
|
truthy
|
||||||
|
|
64
.github/workflows/test.yml
vendored
64
.github/workflows/test.yml
vendored
|
@ -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
|
||||||
|
|
16
README.md
16
README.md
|
@ -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)
|
||||||
|
|
|
@ -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: ''
|
||||||
|
|
28
dist/index.js
vendored
28
dist/index.js
vendored
|
@ -58908,37 +58908,17 @@ if (fix) {
|
||||||
argv.push("--fix");
|
argv.push("--fix");
|
||||||
}
|
}
|
||||||
|
|
||||||
let invoke = true;
|
const parameters = {
|
||||||
const command = core.getInput("command");
|
|
||||||
switch (command) {
|
|
||||||
case "":
|
|
||||||
// Default behavior
|
|
||||||
break;
|
|
||||||
case "config":
|
|
||||||
argv.unshift("--config");
|
|
||||||
break;
|
|
||||||
case "fix":
|
|
||||||
argv.unshift("--fix");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
core.setFailed(`Unsupported command: ${command}`);
|
|
||||||
invoke = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invoke) {
|
|
||||||
const parameters = {
|
|
||||||
argv,
|
argv,
|
||||||
logMessage,
|
logMessage,
|
||||||
"optionsOverride": {
|
"optionsOverride": {
|
||||||
"outputFormatters": [[outputFormatter]]
|
"outputFormatters": [[outputFormatter]]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
markdownlintCli2(parameters).then(
|
markdownlintCli2(parameters).then(
|
||||||
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
||||||
(error) => core.setFailed(`Failed due to error: ${error}`)
|
(error) => core.setFailed(`Failed due to error: ${error}`)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
@ -60,34 +60,14 @@ if (fix) {
|
||||||
argv.push("--fix");
|
argv.push("--fix");
|
||||||
}
|
}
|
||||||
|
|
||||||
let invoke = true;
|
const parameters = {
|
||||||
const command = core.getInput("command");
|
|
||||||
switch (command) {
|
|
||||||
case "":
|
|
||||||
// Default behavior
|
|
||||||
break;
|
|
||||||
case "config":
|
|
||||||
argv.unshift("--config");
|
|
||||||
break;
|
|
||||||
case "fix":
|
|
||||||
argv.unshift("--fix");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
core.setFailed(`Unsupported command: ${command}`);
|
|
||||||
invoke = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invoke) {
|
|
||||||
const parameters = {
|
|
||||||
argv,
|
argv,
|
||||||
logMessage,
|
logMessage,
|
||||||
"optionsOverride": {
|
"optionsOverride": {
|
||||||
"outputFormatters": [[outputFormatter]]
|
"outputFormatters": [[outputFormatter]]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
markdownlintCli2(parameters).then(
|
markdownlintCli2(parameters).then(
|
||||||
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
(code) => code && core.setFailed(`Failed with exit code: ${code}`),
|
||||||
(error) => core.setFailed(`Failed due to error: ${error}`)
|
(error) => core.setFailed(`Failed due to error: ${error}`)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue