Skip to content

Update Proto

Update Proto #19

Workflow file for this run

name: "Update Proto"
on:
workflow_dispatch:
inputs:
branch:
description: "Branch in api-go repo to update protos (default: master)"
required: false
default: master
commit_author:
description: "Commit author username"
required: true
commit_author_email:
description: "Commit author email"
required: true
commit_message:
description: "Commit message"
required: true
jobs:
sync:
name: "Update proto"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.RR_CICD_APP_ID }}
private-key: ${{ secrets.RR_CICD_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ steps.generate_token.outputs.token }}
persist-credentials: true
ref: ${{ github.event.inputs.branch }}
submodules: true
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Setup Buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Rebuild proto
env:
GOTOOLCHAIN: auto
run: make update-proto
- name: Build check
run: |
go build ./...
go mod tidy
go get -u all
- name: Commit update
env:
GIT_AUTHOR_NAME: ${{ github.event.inputs.commit_author }}
GIT_AUTHOR_EMAIL: ${{ github.event.inputs.commit_author_email }}
GIT_COMMITTER_NAME: ${{ github.event.inputs.commit_author }}
GIT_COMMITTER_EMAIL: ${{ github.event.inputs.commit_author_email }}
GIT_COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }}
run: |
git add .
git commit -m "${GIT_COMMIT_MESSAGE}" || echo "No changes to commit"
git push