-
-
Notifications
You must be signed in to change notification settings - Fork 47
30 lines (29 loc) · 1.18 KB
/
check-golangci-lint-config.yml
File metadata and controls
30 lines (29 loc) · 1.18 KB
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
name: check golangci-lint config
on:
pull_request:
push:
branches:
- master
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
golangci-lint-version: ["v1", "v2"]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set TAG_NAME
if: ${{ matrix.golangci-lint-version == 'v1' }}
run: echo "TAG_NAME=v1.64.8" >> "$GITHUB_ENV"
- name: Set TAG_NAME
if: ${{ matrix.golangci-lint-version != 'v1' }}
env:
GH_TOKEN: ${{ secrets.github_token }}
run: echo "TAG_NAME=$(gh release list --repo golangci/golangci-lint --json name,isLatest --jq '.[] | select(.isLatest) | .name')" >> "$GITHUB_ENV"
- name: Install golangci-lint
run: |
curl -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/refs/tags/$TAG_NAME/install.sh" | sh -s -- -b "$(go env GOPATH)/bin" "$TAG_NAME"
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Validate golangci-lint config
run: golangci-lint config verify --config=.github/.golangci.${{ matrix.golangci-lint-version }}.yml