forked from kubernetes-sigs/cluster-api
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (40 loc) · 1.29 KB
/
pr-golangci-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
name: PR golangci-lint
on:
pull_request:
types: [opened, edited, synchronize, reopened]
workflow_dispatch:
# Remove all permissions from GITHUB_TOKEN except metadata.
permissions:
statuses: write
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
working-directory:
- ""
- test
- hack/tools
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # tag=v4.1.5
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # tag=v5.0.1
with:
go-version: ${{ steps.vars.outputs.go_version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@38e1018663fa5173f3968ea0777460d3de38f256 # tag=v5.3.0
with:
version: v1.57.2
args: --out-format=colored-line-number
working-directory: ${{matrix.working-directory}}
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
with:
sha: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}