diff --git a/.github/workflows/weekly-go-version-check.yaml b/.github/workflows/weekly-go-version-check.yaml new file mode 100644 index 000000000000..2d3ea53443c8 --- /dev/null +++ b/.github/workflows/weekly-go-version-check.yaml @@ -0,0 +1,48 @@ +name: Weekly go version check + +on: + # workflow_dispatch: + # push: + # branches: + # - automate-go-patching + schedule: + # Cron for every Mon at 12:00 UTC. + - cron: "0 12 * * 1" + +permissions: + contents: write + pull-requests: write + +jobs: + weekly-go-patch-version-check: + name: Check go patch version + strategy: + fail-fast: false + matrix: + branch: [main] + 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: | + echo "GO_PATCH_VERSION=$(curl --silent https://go.dev/VERSION?m=text | sed -n 's/^go\([0-9.]*\).*/\1/p')" >> $GITHUB_ENV + - name: Replace go_patch_version in Makefile + run: sed -i 's/GO_VERSION ?= [0-9\.]*/GO_VERSION ?= ${{ env.GO_PATCH_VERSION }}/' Makefile + - name: Replace go_patch_version in Tiltfile + run: sed -i 's/golang:[0-9\.]*/golang:${{ env.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 ${{ env.GO_PATCH_VERSION }} + title: "Bump to Go patch version ${{ env.GO_PATCH_VERSION }}" + body: | + This PR promotes current GO version to the latest patch version of ${{ env.GO_PATCH_VERSION }} + branch: promote-go-patch-version-${{ env.GO_PATCH_VERSION }}