From b0f6fa294324506d6de2a6cff1a015887e2aa704 Mon Sep 17 00:00:00 2001 From: Florent Poinsard <35779988+frouioui@users.noreply.github.com> Date: Fri, 5 Jan 2024 11:04:30 -0500 Subject: [PATCH] Automatically update the Golang dependencies using a CRON (#14891) Signed-off-by: Florent Poinsard --- .../workflows/update_golang_dependencies.yml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/update_golang_dependencies.yml diff --git a/.github/workflows/update_golang_dependencies.yml b/.github/workflows/update_golang_dependencies.yml new file mode 100644 index 00000000000..3a3167951f4 --- /dev/null +++ b/.github/workflows/update_golang_dependencies.yml @@ -0,0 +1,56 @@ +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 + 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: main + + - 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-main" + commit-message: "upgrade go deps" + signoff: true + delete-branch: true + title: "Upgrade the Golang Dependencies" + body: | + This Pull Request updates all the Goland dependencies to their latest version using `go get -u ./...`. + base: main + labels: | + go + dependencies + Component: General + Type: Internal Cleanup