-
Notifications
You must be signed in to change notification settings - Fork 289
37 lines (34 loc) · 1.15 KB
/
linting.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
name: "golangci-lint"
on:
pull_request:
paths-ignore:
- 'website/**'
permissions:
contents: read
jobs:
lint:
name: "Run Linter"
runs-on: ${{ fromJSON(vars.RUNNER) }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: '0'
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
# version, because "goenv" can react to it automatically.
run: |
echo "Building with Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "${{ steps.get-go-version.outputs.go-version }}"
- name: Install Dependencies
# if we really need to we can update this to run `make tools`
# later but its just not necessary to only run linters
run: |
make golangci-lint
- name: Running Linters
run: |
LINT_DIFF_BRANCH="origin/${GITHUB_BASE_REF}" make lint-diff