From 43612da6b36d8b3043e8d3fe775101f79b23f8b3 Mon Sep 17 00:00:00 2001 From: Pravar Agrawal Date: Sun, 29 Sep 2024 22:52:46 +0530 Subject: [PATCH 1/2] add code to automate go patch version bump --- .../workflows/weekly-go-version-check.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/weekly-go-version-check.yaml diff --git a/.github/workflows/weekly-go-version-check.yaml b/.github/workflows/weekly-go-version-check.yaml new file mode 100644 index 000000000000..2b018277f224 --- /dev/null +++ b/.github/workflows/weekly-go-version-check.yaml @@ -0,0 +1,39 @@ +name: Weekly go version check + + +on: + schedule: + # Cron for every week at 12:00 UTC. + - cron: "" + +permissions: {} + +jobs: + weekly-go-patch-version-check: + name: Check go patch version + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c + with: + files: | + ./*file | egrep -v "Dockerfile" + - name: Get latest go patch version + id: patch-version + run: | + export GO_PATCH_VERSION=$(curl --silent https://go.dev/VERSION?m=text) + sed -i 's/GO_VERSION=[0-9\.]*/GO_VERSION=$GO_PATCH_VERSION/' Makefile + sed -i 's/golang:[0-9\.]*/golang:$GO_PATCH_VERSION/' Tiltfile + - name: Create Pull Request + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # tag=v7.0.5 + with: + commit-message: Bump to Go ${GO_PATCH_VERSION} + title: "Bump to Go patch version ${GO_PATCH_VERSION}" + body: | + This PR promotes current GO version to the latest patch version of ${GO_PATCH_VERSION} + branch: promote-go-patch-version-${{ GO_PATCH_VERSION }} + + From 8398f5c461a8cdb153c1758b2aa4fa4896daf1ae Mon Sep 17 00:00:00 2001 From: Pravar Agrawal Date: Sun, 29 Sep 2024 22:54:33 +0530 Subject: [PATCH 2/2] update cron values --- .github/workflows/weekly-go-version-check.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/weekly-go-version-check.yaml b/.github/workflows/weekly-go-version-check.yaml index 2b018277f224..7e1aae3f187d 100644 --- a/.github/workflows/weekly-go-version-check.yaml +++ b/.github/workflows/weekly-go-version-check.yaml @@ -1,12 +1,13 @@ name: Weekly go version check - on: schedule: - # Cron for every week at 12:00 UTC. - - cron: "" + # Cron for every Mon at 12:00 UTC. + - cron: "0 12 * * 1" -permissions: {} +permissions: + contents: write + pull-requests: write jobs: weekly-go-patch-version-check: