Skip to content

Commit d0fee21

Browse files
Add static analysis github action
Add golangci-lint action with extra linters besides the default set [1]. Add hadolint and shellcheck. [1] https://golangci-lint.run/usage/linters Signed-off-by: Kennelly, Martin <[email protected]>
1 parent b265857 commit d0fee21

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go-static-analysis
2+
on: [push, pull_request]
3+
jobs:
4+
golangci:
5+
name: Lint
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: golangci-lint
10+
uses: golangci/golangci-lint-action@v2
11+
with:
12+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
13+
version: v1.29
14+
# Adding additional linters beside the default set - See https://golangci-lint.run/usage/linters
15+
args: --enable=golint,bodyclose,gosec,whitespace
16+
shellcheck:
17+
name: Shellcheck
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Run ShellCheck
22+
uses: ludeeus/action-shellcheck@master
23+
hadolint:
24+
runs-on: ubuntu-latest
25+
name: Hadolint
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: brpaz/[email protected]
29+
name: Run Hadolint
30+
with:
31+
dockerfile: Dockerfile
32+
- uses: brpaz/[email protected]
33+
with:
34+
dockerfile: Dockerfile.rhel7
35+

0 commit comments

Comments
 (0)