Skip to content

Commit 646655a

Browse files
committed
feat: verify with the JSONSchema
1 parent 47d1bdb commit 646655a

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,24 @@ with:
318318

319319
</details>
320320

321+
### `verify`
322+
323+
(optional)
324+
325+
If set to true and the action verify the configuration file against the JSONSchema.
326+
327+
<details>
328+
<summary>Example</summary>
329+
330+
```yml
331+
uses: golangci/golangci-lint-action@v6
332+
with:
333+
verify: true
334+
# ...
335+
```
336+
337+
</details>
338+
321339
### `only-new-issues`
322340

323341
(optional)

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ inputs:
2222
description: "the token is used for fetching patch of a pull request to show only new issues"
2323
default: ${{ github.token }}
2424
required: false
25+
verify:
26+
description: "if set to true and the action verify the configuration file against the JSONSchema"
27+
default: 'false'
28+
required: false
2529
only-new-issues:
2630
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
2731
default: 'false'

src/run.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
5151
printOutput(res)
5252
}
5353

54+
if (core.getBooleanInput(`verify`, { required: true })) {
55+
const res = await execShellCommand(`${binPath} verify`)
56+
printOutput(res)
57+
}
58+
5459
let userArgs = core.getInput(`args`)
5560
const addedArgs: string[] = []
5661

0 commit comments

Comments
 (0)