Automatically bump go patch version in main branch go.mod #8392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to Velero!
Please add a summary of your change
Add new action that creates PR to bump version of golang used based on golang version in container image.
https://go.dev/doc/toolchain introduced toolchain to go.mod and we wanted to avoid go mod tidy triggering adding this line.
This PR adds new action that creates PR to bump version of golang used based on golang version in container image and avoids main branch using older golang than release branch (ie. release-1.15 branch uses golang 1.22.8, when main is using older golang 1.22.0).
It is practically impossible to run go mod tidy with just
go 1.22
as some user have requested. A patch version of golang always end up in a separate toolchain line which defeats the purpose of using generic1.22
.At least with this PR, go.mod of main branch will be latest possible golang patch version.
We would expect upon merging that next day or upon manual trigger, a PR with go.mod updated to latest go patch matching container image is created.
See manual runs from this workflow here https://github.com/kaovilai/velero/actions/workflows/auto_bump_golang.yml
PRs created by this workflow: https://github.com/kaovilai/velero/pulls?q=is%3Apr+author%3Aapp%2Fgithub-actions+base%3Amain+head%3Aactions%2Fupdate-go-mod-patch+
This is similar to dependabot updating deps. However, dependabot do not currently updates golang version in go.mod.
Lookout for following log in this PR's action run.
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.