Skip to content

Commit 6236bb6

Browse files
Update actions to use go.mod for Go version management
This commit changes all GitHub Actions to use the go.mod file for specifying the Go version instead of pinning the version directly. This reduces the burden of maintaining the Go version across multiple workflows.
1 parent 8ec703e commit 6236bb6

File tree

36 files changed

+43
-45
lines changed

36 files changed

+43
-45
lines changed

.github/workflows/apidiff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@v5
2424
with:
25-
go-version: "~1.22"
25+
go-version-file: go.mod
2626
- name: Execute go-apidiff
2727
uses: joelanford/[email protected]
2828
with:

.github/workflows/external-plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Go
2727
uses: actions/setup-go@v5
2828
with:
29-
go-version: '1.22.3'
29+
go-version-file: docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
3030

3131
- name: Build Sample External Plugin
3232
working-directory: docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1

.github/workflows/legacy-webhook-path.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Go
2727
uses: actions/setup-go@v5
2828
with:
29-
go-version: '1.22.3'
29+
go-version-file: go.mod
3030
- name: Run make test-legacy
3131
run: make test-legacy
3232

.github/workflows/lint-sample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: '~1.22'
21+
go-version-file: go.mod
2222
- name: Run linter
2323
uses: golangci/golangci-lint-action@v6
2424
with:

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
1616
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
1717
steps:
18+
- name: Clone the code
19+
uses: actions/checkout@v4
1820
- name: Setup Go
1921
uses: actions/setup-go@v5
2022
with:
21-
go-version: '~1.22'
22-
- name: Clone the code
23-
uses: actions/checkout@v4
23+
go-version-file: go.mod
2424
- name: Run linter
2525
uses: golangci/golangci-lint-action@v6
2626
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@v5
2323
with:
24-
go-version: '~1.22'
24+
go-version-file: go.mod
2525
- name: Clean dist directory
2626
run: rm -rf dist || true
2727
- name: Install Syft to generate SBOMs

.github/workflows/test-devcontainer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Go 1.22.x
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: "1.22.x"
21+
go-version-file: go.mod
2222

2323
- name: Setup NodeJS 20.x
2424
uses: actions/setup-node@v4

.github/workflows/test-e2e-book.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Go
2828
uses: actions/setup-go@v5
2929
with:
30-
go-version: '~1.22'
30+
go-version-file: go.mod
3131

3232
- name: Install the latest version of kind
3333
run: |
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup Go
5858
uses: actions/setup-go@v5
5959
with:
60-
go-version: '~1.22'
60+
go-version-file: go.mod
6161

6262
- name: Install the latest version of kind
6363
run: |
@@ -87,7 +87,7 @@ jobs:
8787
- name: Setup Go
8888
uses: actions/setup-go@v5
8989
with:
90-
go-version: '~1.22'
90+
go-version-file: go.mod
9191

9292
- name: Install the latest version of kind
9393
run: |

.github/workflows/test-e2e-samples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Go
2424
uses: actions/setup-go@v5
2525
with:
26-
go-version: '~1.22'
26+
go-version-file: go.mod
2727

2828
- name: Install the latest version of kind
2929
run: |
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup Go
6363
uses: actions/setup-go@v5
6464
with:
65-
go-version: '~1.22'
65+
go-version-file: go.mod
6666

6767
- name: Install the latest version of kind
6868
run: |
@@ -104,7 +104,7 @@ jobs:
104104
- name: Setup Go
105105
uses: actions/setup-go@v5
106106
with:
107-
go-version: '~1.22'
107+
go-version-file: go.mod
108108

109109
- name: Install the latest version of kind
110110
run: |

.github/workflows/test-helm-samples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Go
2424
uses: actions/setup-go@v5
2525
with:
26-
go-version: "~1.22"
26+
go-version-file: go.mod
2727

2828
- name: Install the latest version of kind
2929
run: |

0 commit comments

Comments
 (0)