diff --git a/README.md b/README.md index be93de9..282afa9 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,24 @@ with: +### `verify` + +(optional) + +If set to true and the action verify the configuration file against the JSONSchema. + +
+Example + +```yml +uses: golangci/golangci-lint-action@v6 +with: + verify: true + # ... +``` + +
+ ### `only-new-issues` (optional) diff --git a/action.yml b/action.yml index f4bdaaa..5e8e8e3 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,10 @@ inputs: description: "the token is used for fetching patch of a pull request to show only new issues" default: ${{ github.token }} required: false + verify: + description: "if set to true and the action verify the configuration file against the JSONSchema" + default: 'false' + required: false only-new-issues: description: "if set to true and the action runs on a pull request - the action outputs only newly found issues" default: 'false' diff --git a/src/run.ts b/src/run.ts index 09b0e1d..1bd2461 100644 --- a/src/run.ts +++ b/src/run.ts @@ -51,6 +51,11 @@ async function runLint(binPath: string, patchPath: string): Promise { printOutput(res) } + if (core.getBooleanInput(`verify`, { required: true })) { + const res = await execShellCommand(`${binPath} verify`) + printOutput(res) + } + let userArgs = core.getInput(`args`) const addedArgs: string[] = []