Skip to content
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

✨ Automate go patching version bump #11237

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/weekly-go-version-check.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading