Skip to content

Commit 00584ff

Browse files
committed
Reduce maintenance burden by letting setup-go track our Go versions
`actions/setup-go` supports "stable" and "oldstable" as automatic aliases for the latest release and the previous to latest release, which was our intent with two of these three hard-coded versions. The third is hard-coded to match our `go.mod`, which `actions/setup-go` *also* supports reading from, so we can be completely DRY here. Signed-off-by: Tianon Gravi <[email protected]>
1 parent 5325ec4 commit 00584ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/docs-and-linting.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
strategy:
1111
matrix:
1212
# current Go releases plus the version in the go.mod are tested
13-
go: ['1.18', '1.22', '1.23']
13+
go: ['go.mod', 'oldstable', 'stable']
14+
# https://github.com/actions/setup-go/tree/v5#getting-go-version-from-the-gomod-file
15+
# https://github.com/actions/setup-go/tree/v5#using-stableoldstable-aliases
1416

1517
env:
1618
RELEASE_GO_VER: "1.23"
@@ -24,7 +26,8 @@ jobs:
2426

2527
- uses: actions/setup-go@v5
2628
with:
27-
go-version: ${{ matrix.go }}
29+
go-version: ${{ matrix.go != 'go.mod' && matrix.go || null }}
30+
go-version-file: ${{ matrix.go == 'go.mod' && 'go/src/github.com/opencontainers/image-spec/go.mod' || null }}
2831

2932
- name: Render and Lint
3033
env:

0 commit comments

Comments
 (0)