-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Automatically update the Golang dependencies using a CRON #14891
Changes from 3 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Update Golang Dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # Runs every day at midnight UTC | ||
workflow_dispatch: | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
update_golang_deps: | ||
if: github.repository == 'vitessio/vitess' | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
strategy: | ||
matrix: | ||
branch: [ main, release-18.0, release-17.0, release-16.0 ] | ||
name: Update Golang Dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.5 | ||
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. How will we keep this aligned with the go version as we upgrade that pretty regularly, especially on main. If we do end up doing this on release branches, will this not cause issues when those are using an older version of go than main? 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. The automation that bumps the golang version throughout the codebase will keep this aligned for us without having to do anything more. |
||
|
||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Upgrade the Golang Dependencies | ||
id: detect-and-update | ||
run: | | ||
go get -u ./... | ||
|
||
output=$(git status -s) | ||
if [ -z "${output}" ]; then | ||
exit 0 | ||
fi | ||
|
||
go mod tidy | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
branch: "upgrade-go-deps-on-${{ matrix.branch }}" | ||
commit-message: "upgrade go deps" | ||
signoff: true | ||
delete-branch: true | ||
title: "[${{ matrix.branch }}] Upgrade the Golang Dependencies" | ||
body: | | ||
This Pull Request updates all the Goland dependencies to their latest version using `go get -u ./...`. | ||
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. shoot sorry i missed this s/Goland/Golang 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. Will be fixed with #14896 |
||
base: ${{ matrix.branch }} | ||
labels: | | ||
go | ||
dependencies | ||
Component: General | ||
Type: Internal Cleanup |
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 is the only part that I have some reservations/questions about.