-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
45 lines (41 loc) · 1.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
name: 'Golangci-lint'
description: 'Execute golangci-lint'
inputs:
linters:
description: 'List of all enabled linters'
required: true
ssh-key:
description: 'ssh key'
required: true
github_token:
description: 'github token'
required: true
runs:
using: "composite"
steps:
- id: check
shell: bash
run: if echo "${{ inputs.linters }}" | grep GOLANGCI &> /dev/null; then echo "continue=true" >> "${GITHUB_OUTPUT}"; else echo "continue=false" >> "${GITHUB_OUTPUT}"; fi
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
if: ${{ steps.check.outputs.continue == 'true' }}
with:
ssh-key: ${{ inputs.ssh-key }}
persist-credentials: true
lfs: true
submodules: recursive
# https://github.com/marketplace/actions/run-golangci-lint-with-reviewdog
- uses: reviewdog/action-golangci-lint@v2
if: ${{ steps.check.outputs.continue == 'true' }}
with:
fail_on_error: true
filter_mode: nofilter
github_token: ${{ inputs.github_token }}
# https://github.com/golangci/golangci-lint
golangci_lint_flags: ""
level: info
reporter: github-pr-review
# reviewdog_flags:
tool_name: golangci
workdir: "."