Skip to content

Commit 148d328

Browse files
authored
ci: improve go version management by using go.mod (#2016)
Use `go.mod` to use the Go version instead of the static string in the GitHub Actions files.
1 parent 1aed4a2 commit 148d328

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- uses: actions/setup-go@v5
8383
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}
8484
with:
85-
go-version: "1.23.7" # The Go version to download (if necessary) and use.
85+
go-version-file: go.mod
8686

8787
- name: Build release artifacts
8888
if: ${{ steps.release.outputs.release_created == 'true' || steps.release.outputs.prs_created == 'true' }}

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ permissions:
1212

1313
jobs:
1414
test:
15-
strategy:
16-
matrix:
17-
go-version: [1.23.7]
1815
runs-on: ubuntu-latest
1916
services:
2017
postgres:
@@ -31,12 +28,12 @@ jobs:
3128
--health-timeout 5s
3229
--health-retries 5
3330
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
3433
- name: Install Go
3534
uses: actions/setup-go@v5
3635
with:
37-
go-version: ${{ matrix.go-version }}
38-
- name: Checkout code
39-
uses: actions/checkout@v2
36+
go-version-file: go.mod
4037
- name: Check gofmt
4138
run: |
4239
set -x

0 commit comments

Comments
 (0)