@@ -18,20 +18,15 @@ jobs:
18
18
- name : Checkout code
19
19
uses : actions/checkout@v3
20
20
21
- - name : Export constant environmental variables
22
- uses : cardinalby/export-env-action@v2
23
- with :
24
- envFile : .github/constants.env
25
-
26
21
- name : Install Go
22
+ id : install-go
27
23
uses : actions/setup-go@v4
28
24
with :
29
- go-version : ${{ env.GO_VERSION }}.x
30
- check-latest : true
25
+ go-version-file : go.mod
31
26
32
27
- name : Ensure go.mod was tidied
33
28
run : |
34
- go mod tidy -compat ${{ env.GO_VERSION }}
29
+ go mod tidy -compat ${{ steps.install-go.outputs.go-version }}
35
30
STATUS=$(git status --porcelain go.mod go.sum)
36
31
if [ -n "$STATUS" ]; then
37
32
echo "Running 'go mod tidy' modified go.mod and/or go.sum"
@@ -46,16 +41,10 @@ jobs:
46
41
- name : Checkout code
47
42
uses : actions/checkout@v3
48
43
49
- - name : Export constant environmental variables
50
- uses : cardinalby/export-env-action@v2
51
- with :
52
- envFile : .github/constants.env
53
-
54
44
- name : Install Go
55
45
uses : actions/setup-go@v4
56
46
with :
57
- go-version : ${{ env.GO_VERSION }}.x
58
- check-latest : true
47
+ go-version-file : go.mod
59
48
60
49
- name : Lint with staticcheck
61
50
@@ -71,16 +60,10 @@ jobs:
71
60
- name : Checkout code
72
61
uses : actions/checkout@v3
73
62
74
- - name : Export constant environmental variables
75
- uses : cardinalby/export-env-action@v2
76
- with :
77
- envFile : .github/constants.env
78
-
79
63
- name : Install Go
80
64
uses : actions/setup-go@v4
81
65
with :
82
- go-version : ${{ env.GO_VERSION }}.x
83
- check-latest : true
66
+ go-version-file : go.mod
84
67
85
68
- name : Lint with golangci-lint
86
69
0 commit comments