From 1e5b6609c975f6023b335289c93acab187740b7d Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 21 Nov 2023 14:22:00 -0800 Subject: [PATCH] Remove "command" input deprecated in v11. --- .github/dictionary.txt | 2 ++ .github/workflows/test.yml | 64 ------------------------------------- README.md | 16 ---------- action.yml | 5 --- dist/index.js | 42 +++++++----------------- markdownlint-cli2-action.js | 42 +++++++----------------- 6 files changed, 24 insertions(+), 147 deletions(-) diff --git a/.github/dictionary.txt b/.github/dictionary.txt index 2645e8c..e5c0979 100644 --- a/.github/dictionary.txt +++ b/.github/dictionary.txt @@ -1,5 +1,7 @@ CommonMark config +LLMs markdownlint-cli2-action +npm README truthy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ebe200..9f729b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,70 +69,6 @@ jobs: id: test - run: exit 1 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: name: config (test/errors.md, 2 errors) runs-on: ubuntu-latest diff --git a/README.md b/README.md index e2cd93e..d1fcfd7 100644 --- a/README.md +++ b/README.md @@ -13,22 +13,6 @@ information. ## 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) Path of a file to use for the base configuration object (defaults to none) diff --git a/action.yml b/action.yml index 0cc92a3..36756b5 100644 --- a/action.yml +++ b/action.yml @@ -5,11 +5,6 @@ branding: icon: check-square color: orange 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: description: Path of a file to use for the base configuration object (defaults to none) default: '' diff --git a/dist/index.js b/dist/index.js index 0da7d77..4970579 100644 --- a/dist/index.js +++ b/dist/index.js @@ -58908,37 +58908,17 @@ if (fix) { argv.push("--fix"); } -let invoke = true; -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, - logMessage, - "optionsOverride": { - "outputFormatters": [[outputFormatter]] - } - }; - markdownlintCli2(parameters).then( - (code) => code && core.setFailed(`Failed with exit code: ${code}`), - (error) => core.setFailed(`Failed due to error: ${error}`) - ); -} +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}`) +); })(); diff --git a/markdownlint-cli2-action.js b/markdownlint-cli2-action.js index 324711d..b69685a 100644 --- a/markdownlint-cli2-action.js +++ b/markdownlint-cli2-action.js @@ -60,34 +60,14 @@ if (fix) { argv.push("--fix"); } -let invoke = true; -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, - logMessage, - "optionsOverride": { - "outputFormatters": [[outputFormatter]] - } - }; - markdownlintCli2(parameters).then( - (code) => code && core.setFailed(`Failed with exit code: ${code}`), - (error) => core.setFailed(`Failed due to error: ${error}`) - ); -} +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}`) +);