File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- name : golangci-lint-reusable
2+ name : golangci-lint
33
44on :
5- workflow_call :
6- inputs :
7- os :
8- description : ' OS'
9- required : true
10- type : string
11- go-version :
12- description : ' Go version'
13- required : true
14- type : string
15- default : stable
16- golangci-lint-version :
17- description : ' Golangci-lint version'
18- type : string
19- default : ' v2.4.0'
5+ pull_request :
6+ push :
7+ branches :
8+ - main
9+ - master
10+
11+ env :
12+ GO_VERSION : stable
13+ GOLANGCI_LINT_VERSION : v2.4.0
2014
2115jobs :
2216 detect-modules :
23- runs-on : ${{ inputs.os }}
17+ runs-on : ubuntu-latest
2418 outputs :
2519 modules : ${{ steps.set-modules.outputs.modules }}
2620 steps :
2721 - uses : actions/checkout@v4
2822 - uses : actions/setup-go@v5
2923 with :
30- go-version : ${{ inputs.go-version }}
24+ go-version : ${{ env.GO_VERSION }}
3125 - id : set-modules
32- # required for Windows to be able to use $GITHUB_OUTPUT https://github.com/actions/runner/issues/2224
33- shell : bash
3426 run : echo "modules=$(go list -m -json | jq -s '.' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
3527
3628 golangci-lint :
3729 needs : detect-modules
38- runs-on : ${{ inputs.os }}
30+ runs-on : ubuntu-latest
3931 strategy :
4032 matrix :
4133 modules : ${{ fromJSON(needs.detect-modules.outputs.modules) }}
4234 steps :
4335 - uses : actions/checkout@v4
4436 - uses : actions/setup-go@v5
4537 with :
46- go-version : ${{ inputs.go-version }}
38+ go-version : ${{ env.GO_VERSION }}
4739 - name : golangci-lint ${{ matrix.modules }}
4840 uses : golangci/golangci-lint-action@v8
4941 with :
50- version : ${{ inputs.golangci-lint-version }}
42+ version : ${{ env.GOLANGCI_LINT_VERSION }}
5143 working-directory : ${{ matrix.modules }}
You can’t perform that action at this time.
0 commit comments