Skip to content

Update bufbuild/buf Version #1

Update bufbuild/buf Version

Update bufbuild/buf Version #1

name: Update bufbuild/buf Version
on:
workflow_dispatch:
inputs:
version:
type: string
description: The version you intend to release (e.g. x.y.z)
required: true
permissions:
contents: write
pull-requests: write
env:
RELEASE_BUF_VERSION: ${{ github.event.inputs.version }}
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Validate input version
if: ${{ startsWith(github.event.inputs.version, 'v') }}
run: |
echo "error: version must not start with 'v'."
exit 1
- name: Checkout repository code
uses: actions/checkout@v4
with:
token: ${{ steps.app_token.outputs.token }}
- name: Update Buf Version
run: make updatebufversion
- name: Create PR
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
BRANCH="release/v${RELEASE_BUF_VERSION}"
git switch -C ${BRANCH}
git add make/go/dep_buf.mk
git commit -m "Update version to ${RELEASE_BUF_VERSION}"
git push --set-upstream origin --force ${BRANCH}
gh pr create --title "Update buf version to v${RELEASE_BUF_VERSION}" --body "Update buf version to newly released version, ${RELEASE_BUF_VERSION}."