-
Notifications
You must be signed in to change notification settings - Fork 46
ci go improvements #1631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
ci go improvements #1631
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -137,8 +137,7 @@ jobs: | |||||||
| persist-credentials: false | ||||||||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||||||||
| with: | ||||||||
| go-version: "1.26" | ||||||||
| check-latest: true # Always check for the latest patch release | ||||||||
| go-version-file: "go.mod" | ||||||||
| - run: make test-go | ||||||||
| - name: Upload Go test coverage to Codecov | ||||||||
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | ||||||||
|
|
@@ -161,8 +160,7 @@ jobs: | |||||||
| persist-credentials: false | ||||||||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||||||||
| with: | ||||||||
| go-version: "1.26" | ||||||||
| check-latest: true # Always check for the latest patch release | ||||||||
| go-version-file: "go.mod" | ||||||||
|
||||||||
| go-version-file: "go.mod" | |
| go-version-file: "go.mod" | |
| check-latest: true |
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other Go jobs: after switching to go-version-file, check-latest: true was removed. Unless you intentionally want to test an older cached patch, re-add check-latest: true to keep linting aligned with the patch level used elsewhere.
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job also switched to go-version-file without check-latest: true. If the goal is “use Go version from go.mod but always get the newest patch”, add check-latest: true here to avoid running controller-gen/manifests generation on a different patch level than other Go checks.
| go-version-file: "go.mod" | |
| go-version-file: "go.mod" | |
| check-latest: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ on: | |
| push: | ||
| paths: | ||
| - go.sum | ||
| - go.mod | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
|
|
@@ -14,12 +15,16 @@ jobs: | |
| name: govulncheck | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install Golang | ||
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| # checkout the source, required to have `go.mod` | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| go-version: "1.26" | ||
| check-latest: true # Always check for the latest patch release | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - name: govulncheck | ||
| uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4 | ||
| with: | ||
| # required to override the default value that is 'stable' | ||
| # in this way `go-version-file` is going to be taken into account | ||
| go-version-input: "" | ||
| go-version-file: "go.mod" | ||
|
Comment on lines
+28
to
+29
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would include the input to disable patch version updates |
||
| go-package: ./... | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/setup-gois now driven bygo.mod, but this step no longer setscheck-latest: true. That can lead to CI running a different (and potentially older) Go patch level than other workflows (e.g. govulncheck still forces the latest patch). Consider re-addingcheck-latest: truehere (or alternatively pin via atoolchain go1.x.ydirective in go.mod if you want deterministic patch selection).