Skip to content

Commit 15a076e

Browse files
committed
feat: add an option to disable problem matchers
1 parent 38e1018 commit 15a076e

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,23 @@ with:
232232
# ...
233233
```
234234

235+
### `problem-matchers`
236+
237+
(optional)
238+
239+
To enable/disable GitHub Action annotations problem matchers (requires `annotations: true`.
240+
241+
The problem matchers allows the display file information (path, position) inside the logs.
242+
243+
The default value is `true`.
244+
245+
```yml
246+
uses: golangci/golangci-lint-action@v5
247+
with:
248+
problem-matchers: false
249+
# ...
250+
```
251+
235252
### `args`
236253

237254
(optional)

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ inputs:
4040
description: "To Enable/disable GitHub Action annotations"
4141
default: 'true'
4242
required: false
43+
problem-matchers:
44+
description: "To Enable/disable GitHub Action annotations problem matchers"
45+
default: 'true'
46+
required: false
4347
args:
4448
description: "golangci-lint command line arguments"
4549
default: ""

src/run.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,17 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
188188
const annotations = core.getBooleanInput(`annotations`)
189189

190190
if (annotations) {
191+
let ghaFormat = `github-actions-problem-matchers`
192+
if (!core.getBooleanInput(`problem-matchers`)) {
193+
ghaFormat = `github-actions`
194+
}
195+
191196
const formats = (userArgsMap.get("out-format") || "")
192197
.trim()
193198
.split(",")
194199
.filter((f) => f.length > 0)
195-
.filter((f) => !f.startsWith(`github-actions`))
196-
.concat("github-actions")
200+
.filter((f) => !f.startsWith(ghaFormat))
201+
.concat(ghaFormat)
197202
.join(",")
198203

199204
addedArgs.push(`--out-format=${formats}`)

0 commit comments

Comments
 (0)