Skip to content

Commit 5f2bc92

Browse files
authored
Use go-version-file parameter for the Go install action (#72)
1 parent 6b6b768 commit 5f2bc92

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17-
- name: Determine Go version from go.mod
18-
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV
19-
2017
- uses: actions/setup-go@v6
2118
with:
22-
go-version: ${{ env.GO_VERSION }}
19+
go-version-file: 'go.mod'
2320

2421
- name: Run linters
2522
run: make lint

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ jobs:
1313
with:
1414
fetch-depth: 0
1515

16-
- name: Determine Go version from go.mod
17-
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV
18-
1916
- uses: actions/setup-go@v6
2017
with:
21-
go-version: ${{ env.GO_VERSION }}
18+
go-version-file: 'go.mod'
2219

2320
- name: Login to Quay.io
2421
uses: docker/login-action@v3

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17-
- name: Determine Go version from go.mod
18-
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV
19-
2017
- uses: actions/setup-go@v6
2118
with:
22-
go-version: ${{ env.GO_VERSION }}
19+
go-version-file: 'go.mod'
2320

2421
- name: Run tests
2522
run: make test

0 commit comments

Comments
 (0)