-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (41 loc) · 1.26 KB
/
lint.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
46
47
48
name: "Lint"
on:
pull_request:
branches: ["master"]
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
go-lint:
name: Lint Go
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up Go (no caching)
uses: actions/setup-go@v5
with:
go-version: '1.17'
cache-dependency-path: go.sum
- name: Lint using golangci-lint
uses: golangci/[email protected]
with:
skip-pkg-cache: true
skip-build-cache: true
version: v1.56
only-new-issues: true
args: --timeout=10m --issues-exit-code=1
- name: Generating Golang lint results as summary
if: ${{ always() }}
run: |
golangci-lint run > lint_results.txt || true
lint_results=$(cat lint_results.txt)
echo -e "## 🪧 Go Lint Results\n" >> $GITHUB_STEP_SUMMARY
if [ -z "$lint_results" ]; then
echo -e "### No Lint Issues found.\n" >> $GITHUB_STEP_SUMMARY
else
echo -e "### List of Lint Issues \n" >> $GITHUB_STEP_SUMMARY
echo -e "${lint_results}" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true