Skip to content

Commit

Permalink
add update go deps workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Jan 4, 2024
1 parent 2b3f739 commit f9457ac
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/update_golang_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update Golang Dependencies

on:
pull_request:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight UTC
workflow_dispatch:

permissions: read-all

jobs:
update_golang_version:
# 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

- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}

- name: Detect new version and update codebase
env:
GH_TOKEN: ${{ github.token }}
id: detect-and-update
run: |
go get -u ./...
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
- 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 ./...`.
base: ${{ matrix.branch }}
labels: |
go
dependencies
Component: General
Type: Internal Cleanup

0 comments on commit f9457ac

Please sign in to comment.