Automate Go version updates via scheduled workflow#21324
Conversation
Co-authored-by: mbg <278086+mbg@users.noreply.github.com>
Co-authored-by: mbg <278086+mbg@users.noreply.github.com>
Co-authored-by: mbg <278086+mbg@users.noreply.github.com>
Co-authored-by: mbg <278086+mbg@users.noreply.github.com>
Co-authored-by: mbg <278086+mbg@users.noreply.github.com>
|
@copilot This only looks at major.minor, but actually we really care about the patch number as well. Please update it. Note that |
Updated the workflow to use full version numbers (including patch) in commit messages, PR title, and PR body. The version comparison was already correctly comparing full versions including patch numbers (line 76), but the messages were only showing major.minor. Fixed in commit ef29d22. |
93f8f59 to
6b74874
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a scheduled GitHub Actions workflow to automatically detect the latest Go release and, when it differs from the repo’s pinned version, update the relevant version pins and open/update a PR on a dedicated branch.
Changes:
- Introduces a weekly + manual-trigger workflow to fetch the latest Go version from
go.dev/dl/?mode=jsonand compare it toMODULE.bazel. - Automatically edits the Go version in
MODULE.bazel,go/extractor/go.mod,go/extractor/autobuilder/build-environment.go, andgo/actions/test/action.yml. - Creates or updates a PR from
workflow/go-version-updatewith the changes.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/go-version-update.yml | Adds the automation that fetches Go versions, applies updates across multiple files, and opens/updates a PR on a scheduled cadence. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 4
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
I checked and the comment seems to be correct. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Manual Go version updates require tracking releases and updating multiple files with different version format requirements. This workflow automates the process.
Implementation
Workflow:
.github/workflows/go-version-update.ymlgo.dev/dl/?mode=jsonfor latest releaseMODULE.bazelversion (full version including patch number)MODULE.bazel→go_sdk.download(version = "1.26.0")go/extractor/go.mod→go 1.26andtoolchain go1.26.0go/extractor/autobuilder/build-environment.go→maxGoVersion = "1.26"go/actions/test/action.yml→default: "~1.26.0"workflow/go-version-updatebranchExcluded from automation:
go/ql/**- Query-specific code requiring manual reviewdocs/**- Documentation requiring manual updatesTechnical Details
sed -Efor cross-platform regex compatibility (GNU/BSD)Example
When Go 1.27.0 releases:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.