mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-14 23:11:14 +00:00
feat: add an option to disable problem matchers
This commit is contained in:
parent
38e1018663
commit
6fa8b5b204
3 changed files with 28 additions and 2 deletions
17
README.md
17
README.md
|
|
@ -232,6 +232,23 @@ with:
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `problem-matchers`
|
||||||
|
|
||||||
|
(optional)
|
||||||
|
|
||||||
|
To enable/disable GitHub Action annotations problem matchers (requires `annotations: true`).
|
||||||
|
|
||||||
|
The problem matchers allows the display file information (path, position) inside the logs.
|
||||||
|
|
||||||
|
The default value is `true`.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
uses: golangci/golangci-lint-action@v5
|
||||||
|
with:
|
||||||
|
problem-matchers: false
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
### `args`
|
### `args`
|
||||||
|
|
||||||
(optional)
|
(optional)
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ inputs:
|
||||||
description: "To Enable/disable GitHub Action annotations"
|
description: "To Enable/disable GitHub Action annotations"
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
required: false
|
||||||
|
problem-matchers:
|
||||||
|
description: "To Enable/disable GitHub Action annotations problem matchers"
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
args:
|
args:
|
||||||
description: "golangci-lint command line arguments"
|
description: "golangci-lint command line arguments"
|
||||||
default: ""
|
default: ""
|
||||||
|
|
|
||||||
|
|
@ -188,12 +188,17 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
|
||||||
const annotations = core.getBooleanInput(`annotations`)
|
const annotations = core.getBooleanInput(`annotations`)
|
||||||
|
|
||||||
if (annotations) {
|
if (annotations) {
|
||||||
|
let ghaFormat = `github-actions-problem-matchers`
|
||||||
|
if (!core.getBooleanInput(`problem-matchers`)) {
|
||||||
|
ghaFormat = `github-actions`
|
||||||
|
}
|
||||||
|
|
||||||
const formats = (userArgsMap.get("out-format") || "")
|
const formats = (userArgsMap.get("out-format") || "")
|
||||||
.trim()
|
.trim()
|
||||||
.split(",")
|
.split(",")
|
||||||
.filter((f) => f.length > 0)
|
.filter((f) => f.length > 0)
|
||||||
.filter((f) => !f.startsWith(`github-actions`))
|
.filter((f) => !f.startsWith(ghaFormat))
|
||||||
.concat("github-actions")
|
.concat(ghaFormat)
|
||||||
.join(",")
|
.join(",")
|
||||||
|
|
||||||
addedArgs.push(`--out-format=${formats}`)
|
addedArgs.push(`--out-format=${formats}`)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue