-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (44 loc) · 1.32 KB
/
reusable-golangci-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
name: reusable golangci lint
on:
workflow_call:
inputs:
config:
type: string
required: false
description: |
a .golangci.yml configuration file.
Warning: setting this field will override an existing config
setup:
required: false
type: string
description: |
shell commands to setup the test environment
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- if: ${{ startsWith(github.repository, 'GeoNet/') == false }}
name: require GeoNet org
run: |
exit 1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
check-latest: true
- name: write .golangci.yml
if: ${{ inputs.config }}
run: |
echo "Using config:"
echo '${{ inputs.config }}' | tee .golangci.yml
- name: setup
run: |
eval '${{ inputs.setup }}'
- name: golangci-lint
uses: GeoNet/golangci-lint-action@1b9b0798df716be5ff7cebc26795b000939a4b41 # master
continue-on-error: true
with:
version: v1.63.4
args: --timeout 30m -E gosec