-
Notifications
You must be signed in to change notification settings - Fork 95
39 lines (32 loc) · 1.18 KB
/
pr-static-code-analysis.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
name: Run Static Code Analysis
# This workflow uses golangci-lint to run static code analysis on PRs
# In addition to default golanci-linters checks vulnerability checks (gosec),
# closing of openend http bodies (bodyclose), cyclomatic complexity (cyclop),
# exhaustive switches (exhaustive) and open TODO/FIXME comments (godox)
on:
pull_request:
branches: [ main ]
merge_group: # run if triggered as part of a merge queue
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: 🛠️ Set up Go 1.x
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0
with:
go-version: '~1.23'
- name: ⬇️ Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: ✍️ Check format
run: make lint
- name: 🕵️ Go vet
run: make vet
- name: 🔎 golangci-lint
uses: reviewdog/action-golangci-lint@dd3fda91790ca90e75049e5c767509dc0ec7d99b #v2.7.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check