-
Notifications
You must be signed in to change notification settings - Fork 2.6k
53 lines (44 loc) · 1.34 KB
/
lint.yaml
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
49
50
51
52
53
name: Lint
on:
pull_request:
branches: [ master ]
jobs:
lint:
name: Markdown, Go and OAS
runs-on: ubuntu-latest
permissions:
contents: read # to fetch code (actions/checkout)
checks: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Lint markdown
uses: nosborn/github-action-markdown-cli@v3.4.0
with:
files: '.'
config_file: ".markdownlint.json"
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Go formatting
run: |
if [ -z "$(gofmt -l .)" ]; then
echo -e "All '*.go' files are properly formatted."
else
echo -e "Please run 'make go-lint' to fix. Some files need formatting:"
gofmt -d -l .
exit 1
fi
# https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#verify
- name: Verify linter configuration and Lint go code
uses: golangci/golangci-lint-action@v6
with:
verify: true
args: --timeout=30m
version: v1.64
# Run Spectral
- name: Lint OpenAPI spec
uses: stoplightio/spectral-action@2ad0b9302e32a77c1caccf474a9b2191a8060d83 # v0.8.11
with:
file_glob: 'api/*.yaml'